[
https://issues.apache.org/jira/browse/KARAF-1019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13152607#comment-13152607
]
Glen Mazza commented on KARAF-1019:
-----------------------------------
The business case for explicitly setting these memory options in startup
scripts is probably very similar for both Karaf and Tomcat, so perhaps the
latter's much longer experience might be instructive. From what I can see
Tomcat doesn't explicitly set these options, instead the user optionally
declares an OS environment variable like so:
export CATALINA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=256m"
and Tomcat automatically reads those in on startup. (Perhaps most users don't
bother making settings such as these until they have a perm gen or other memory
error, and then they configure it.) What's also nice with Tomcat is that the
memory settings aren't at the JVM-level but just the Tomcat-level instead,
i.e., you can start other Java programs and the above settings would be ignored.
I don't have a strong position on this either way, but should we go with
Alexey's preference of not explicitly making these settings it probably
wouldn't be that horrifying to the user community, as Tomcat's heavy user base
has been accustomed to this for years.
> Set java memory options only when required
> ------------------------------------------
>
> Key: KARAF-1019
> URL: https://issues.apache.org/jira/browse/KARAF-1019
> Project: Karaf
> Issue Type: Improvement
> Components: karaf-core
> Affects Versions: 2.2.4
> Environment: Windows 2003 @ amd64
> jdk1.6.0_29 x64
> Reporter: Alexey Markevich
> Assignee: Jean-Baptiste Onofré
> Fix For: 2.2.5, 3.0.0
>
> Attachments: karaf, karaf.bat, karaf.bat, set_java
> memory_options_only_when_required.patch, set_java
> memory_options_only_when_required_unix.patch
>
>
> Related to https://issues.apache.org/jira/browse/KARAF-818
> Using my x64 environment I got PermGen space error.
> Sure - I can change JAVA_MAX_MEM, JAVA_PERM_MEM, JAVA_MIN_MEM,
> JAVA_MAX_PERM_MEM variables.
> But I found that without memory settings [1] my scenario works fine.
> Is it possible to set java memory options only if variables are present?
> 1. set DEFAULT_JAVA_OPTS=-server -Dderby.system.home="%KARAF_DATA%\derby"
> -Dderby.storage.fileSyncTransactionLog=true -Dcom.sun.management.jmxremote
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira