How can I disable Java garbage collector?

后端 未结 8 1151
你的背包
你的背包 2020-12-08 19:16

We have a PHP webapp that calls a Java binary to produce a PDF report (with JasperReports). The Java binary outputs the PDF to standard output and exits; the PHP then sends

相关标签:
8条回答
  • 2020-12-08 19:52

    To avoid garbage collector release a variable or property from any object, you must set this property (released by gc) as static in your class it was my solution.

    Example:

    private static String myProperty;

    0 讨论(0)
  • 2020-12-08 19:55

    GC only kicks in when JVM is short on memory, so you either GC or die. Try turning on verbose GC and see if it actually takes significant amount of time.

    java -verbose:gc
    
    0 讨论(0)
提交回复
热议问题