Loading data Vs heapsize occupy

If I want to make a graph between the amount of data being loaded and cache occupancy and when it triggers OOM . or circuit breaker Exception .

How to check the amount of being loaded for sorting

for example my heap size is 1.5gb

how can I check the amount of data loaded in cache after executing the query

with out using plugin

I guess

curl esnode:9200/_nodes/nodename/stats?pretty

is what you looking for. There you can see fielddata, filter_cache, heap size, etc..

Also see: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html