[ https://issues.apache.org/jira/browse/SOLR-13492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17069290#comment-17069290 ]
Munendra S N commented on SOLR-13492: ------------------------------------- I had suggested [~kgsdora] to pick this up. So, trying to address/answer some of the above concerns I have tried with jcmd, jconsole, visualvm and [jmxterm|https://github.com/jiaqi/jmxterm] and with only master branch (java 11) In case of troubleshooting memory issues, it could be either local debugging or remote debugging. For production system, usually only remote debugging be possible. h2. Local Debugging h3. jcmd * Force triggering GC works even with {{DisableExplicitGC}}. We could run {{GC.run}} (with disable works only with jdk > 10 https://bugs.openjdk.java.net/browse/JDK-8186902) to force gc. There are other commands to force gc which works in java 8 too {{GC.class_histogram}} and {{GC.class_stats}} h3. jconsole and visualvm * Both comes with GUI. These identify local processes by checking hsperfdata_{{yourusername}} in tmp directory for pids. At present, GC config contains {{-XX:+PerfDisableSharedMem}} due to which pids [won't be present| http://jtuts.com/2017/02/04/jconsole-not-showing-local-processes/] in above folder. So, with default settings shipped with solr jconsole and visualvm can't identify local processes * I tested with removing the above flag and adding {{-XX:+DisableExplicitGC}}, gc now button in jconsole and visualvm doesn't work h3. jmxterm * This needs to jmx enabled h2. Remote debugging h3. jcmd * jcmd needs process id. Not sure if remote debugging is possible h3. jconsole and visualvm * If the process has jmx monitoring enabled then, remote debugging is possible. Solr ships with jmx disabled by default * I tried enabling and with {{-XX:+DisableExplicitGC}} and gc now button won't trigger gc * For visualvm, there is option to connect using jstatd but I haven't tried it h4. jmxterm (terminal tool) * This needs jmx monitoring enabled * This would behave similar to jcmd for local even with {{-XX:+DisableExplicitGC}}, gc can forced I checked the usage of {{System.gc()}} in lucene/solr. It is used in 1/2 lucene tests and lucene benchmark. Also, checked potential problems for disabling explicit gc and found [this|https://stackoverflow.com/questions/32912702/impact-of-setting-xxdisableexplicitgc-when-nio-direct-buffers-are-used?rq=1]. With the current default which Solr is shipped with both local or remote debugging is not possible via jconsole. With all things considered, I still think, shipping with {{-XX:+DisableExplicitGC}} is good choice and there are ways to force gc even with the above JVM flag but I haven't yet found GUI tool for this. [~erickerickson] If there are still concerns or objections I would be happy to answer them. Alternative solution is to add {{-XX:+ExplicitGCInvokesConcurrent}} so that any force gc is triggered concurrently > Disallow explicit GC by default during Solr startup > --------------------------------------------------- > > Key: SOLR-13492 > URL: https://issues.apache.org/jira/browse/SOLR-13492 > Project: Solr > Issue Type: Improvement > Components: scripts and tools > Reporter: Shawn Heisey > Assignee: Shawn Heisey > Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > Solr should use the -XX:+DisableExplicitGC option as part of its default GC > tuning. > None of Solr's stock code uses explicit GCs, so that option will have no > effect on most installs. The effective result of this is that if somebody > adds custom code to Solr and THAT code does an explicit GC, it won't be > allowed to function. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org