How can I find the query that is eating up my memory?

Hello guys,
I did set the slowlogs to minimum time but when I read it all and try to find pattern by timestamp, all queries seems lightweight and are taking less than 500ms.

is there a way to know the effect of each query to the jvm memory pressure ?

ec46d71128d906fe6cf08150f69bb158d3ff2b35

Am I looking at this the wrong way ?

Followup question: any solution to keep it constant ? I tried to regularly running the clear cache API, but it does not seems to reduce the memory usage (was it suppose to reduce it ?) POST /xxx/_cache/clear

Again this happened even after I increased the JVM memory from 30 to 40GB

Near these red columns, suddenly the system started to eating up a lot of memory.

Funny thing is that the reason is not the system load, nor index memory, nor CPU utilizando oi I/O Ops.

You can see a decrease the activity because it hit a circuit break and crashed.

Looking at the query slowlogs I don't see anything different.
I am lost here...