Am 20.03.2017 um 09:30 schrieb André Warnier (tomcat): > One may wonder in fact : if when resizing the Heap downwards, the JVM > is anyway not going to give the surplus memory back to the OS, then > why bother ? what is the surplus ex-Heap memory then used > interestingly for, by the JVM ?
There's no real "resizing the heap downward". There's garbage collection, because the heap can't be grown any more (or because it's triggered by other means), but this just frees up some heap for more objects, it doesn't resize the heap. Some of the garbage collectors (predominantly old-generation collectors) do not even compact the heap, so that no block could be returned to the OS - and this might be the clue we're looking for as to why nothing is ever returned to the OS: There's just no contiguous block of memory that could be freed. Naturally the "surplus" heap (which is the heap freed up in former garbage collection) is used for new objects that will be created over time. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org