Big applications create huge numbers of objects. Though Java manages the memory allocation and de-allocation for these objects, sometimes this huge number can result in memory leak problem. To monitor when and how much garbage collection is happening, use the following example method:
- Suppose you start your application as:
java MyMainClass option1 option2..... - To determine when garbage collection is happening, start your application as:
java -verbose:gc MyMainClass option1 option2..... - If garbage collection takes place, your output should show something like this:
[GC 511K->105K(1984K), 0.0029585 secs]
The numbers before and after the arrow indicate the combined size of live objects before and after garbage collection. The number in parenthesis is the total available space, which is the total heap minus one of the survivor spaces.
Note: Remember that the figures in the output depend on your application and JVM.
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.
Related Posts
- EMC Buys Cloud Management Vendor Virtustream
- Cisco Buys IoT Vendor Jasper Technologies for $1.4 Billion
- China plans Tianwen-3 Mars launch 2028; return Martian soil 2031
- Flexera Software Launches AdminStudio Inventory and Rationalisation, Helping Enterprises Tackle ???Application Sprawl???
- Jones escorted from Wichita County Auditor’s Office























