Eclipse: Garbage Collector Button

前端 未结 3 1917
礼貌的吻别
礼貌的吻别 2020-12-08 00:19

What happens when I press the \"Run Garbage Collector\" button in Eclipse? Does it just call System.gc()?

相关标签:
3条回答
  • 2020-12-08 00:56

    Yes, the System.gc() is called!

    Very useful in the Eclipse –>Preferences–>General-> Show heap status

    enter image description here

    then you can see in the lower right corner the "trash can" to run the Garbage Collector. =)

    0 讨论(0)
  • 2020-12-08 01:03

    Yes, System.gc() is called when the "Run Garbage Collector" button is pressed.

    0 讨论(0)
  • 2020-12-08 01:04

    Yes, it is strictly a call to the JVM, not to an internal Eclipse function (see this thread).

    Don't forget the Memory Analyzer to also check paths to garbage collection roots (in a Head Dump) if you suspect some memory leaking in your Eclipse session.

    Note: that button is only available if you select the "Show Heap status" in the General section of the Eclipse preferences:

    alt text

    0 讨论(0)
提交回复
热议问题