I'm trying to understand java garbage collection. There are four measurement in garbage collection mentioned here:
Footprint is the working set of a process, measured in pages and cache lines. On systems with limited physical memory or many processes, footprint may dictate scalability.
I can understand the other three, but what exactly is Footprint
and how to optimize it?
Footprint is the amount of memory allocated by a process.
Optimizing it means storing less things in memory for less time (don't load what you don't need, free memory as soon as possible ie. dont keep reference on no more used variable).
Reducing footprint may come with an additional overhead in CPU or other IO (memory is quick to access much more than file system or network).
You can also reduce the whole java process footpting by limiting the maxmimum amount of memory allocated (-Xmx JVM option) however working with few memory will trigger more (more often and longer) garbage collector calls and will so use more CPU).
A good example of footprint reduction would be processing an XML tree using a pull parser (parse the tree chunk by chunck) instead of DOM (load the whole tree in memory to process it)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With