When running queries containing sort I experience
java.lang.OutOfMemoryError: Java heap space.
When looking into the generated heapdump file the sinner seems to be
One instance of
loaded by "sun.misc.Launcher$AppClassLoader @ 0xf42c0a90" occupies
60.526.328 (38,54%) bytes. The memory is accumulated in one instance of
"java.util.concurrent.ConcurrentHashMap$Segment" loaded by "".
(Don't mind the sizes, I have deliberately minimized the jvm heap to be
able to easy reproduce the problem).
- Is the Field Cache shared by all clients?
- How can I choose which cache to use
(ResidentFieldDataCache, SoftFieldDataCache, WeakFieldDataCache, MyOwn?)?
3.a How can I decide the value of index.cache.field.max_size (If I only
have one client, clearing the cache before each search, fetching maximum N
number of documents, sorted by a String field, with M shards containing the
indexes to be searched)?
3.b What happens if the cache cannot contain the fields needed for sorting
a single search request?
- Is it only by measuring I can find the relevant -Xmx value for the JVM
handling the client query or can this be calculated?
Thanks for any input.
Best regards Trym