I've been working on optimizing a program that was having a lot of issues with memory leaks. The leaks are gone now, but the occasional runs of the major GC still put a good dent in PS old gen. I know that I can check basic overall memory information through Runtime, but is it possible to check usage in PS eden, PS survivor, and PS old from within the program?
This article can help you out
You can write custom code to analyze memory & output will be in the form
collection time: 82037
collection count: 116
PS Survivor Space: init = 1703936(1664K) used = 65536(64K) committed = 32047104(31296K) max = 32047104(31296K)
PS Eden Space: init = 10551296(10304K) used = 0(0K) committed = 69795840(68160K) max = 113049600(110400K)
PS Old Gen: init = 27983872(27328K) used = 239432344(233820K) committed = 357957632(349568K) max = 357957632(349568K)
Code Cache: init = 2555904(2496K) used = 19949568(19482K) committed = 20185088(19712K) max = 50331648(49152K)
PS Perm Gen: init = 21757952(21248K) used = 148450536(144971K) committed = 155058176(151424K) max = 268435456(262144K)
Good read
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