Skip to main content
added 109 characters in body
Source Link
Paul de Vrieze
  • 4.9k
  • 1
  • 27
  • 29

You normally should not have any reason to force garbage collection. Doing so, messes up the garbage collector algorithms (mainly their performance). It will also slow down the program while garbage is being collected. If there is a memory issue, you should use memory tracing tools to find out where references are being held? (Are listeners unregistered?)

As in the other answers, you can use jconsole or jvisualvm. You can also use jmx to do it programmatically.

You normally should not have any reason to force garbage collection. Doing so, messes up the garbage collector algorithms (mainly their performance). It will also slow down the program while garbage is being collected. If there is a memory issue, you should use memory tracing tools to find out where references are being held? (Are listeners unregistered?)

You normally should not have any reason to force garbage collection. Doing so, messes up the garbage collector algorithms (mainly their performance). It will also slow down the program while garbage is being collected. If there is a memory issue, you should use memory tracing tools to find out where references are being held? (Are listeners unregistered?)

As in the other answers, you can use jconsole or jvisualvm. You can also use jmx to do it programmatically.

Source Link
Paul de Vrieze
  • 4.9k
  • 1
  • 27
  • 29

You normally should not have any reason to force garbage collection. Doing so, messes up the garbage collector algorithms (mainly their performance). It will also slow down the program while garbage is being collected. If there is a memory issue, you should use memory tracing tools to find out where references are being held? (Are listeners unregistered?)