[ 
https://issues.apache.org/jira/browse/KARAF-1241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13219122#comment-13219122
 ] 

Jonathan Anstey commented on KARAF-1241:
----------------------------------------

Ah OK, makes sense. Thanks for looking at this JB. 

IMO it isn't very intuitive to users though. One would expect the 
JAVA_MIN_MEM/JAVA_MAX_MEM environment variables to be used since they are there 
in the script (like in bin/karaf). To not confuse users we should remove those 
variables altogether or just change the script comment to be different from 
bin/karaf (since the behaviour is different). Maybe something like:

{code}
Index: assemblies/apache-karaf/src/main/filtered-resources/bin/admin
===================================================================
--- assemblies/apache-karaf/src/main/filtered-resources/bin/admin       
(revision 1294797)
+++ assemblies/apache-karaf/src/main/filtered-resources/bin/admin       
(working copy)
@@ -29,6 +29,9 @@
 
 #
 # Check/Set up some easily accessible MIN/MAX params for JVM mem usage
+# 
+# Note that these memory settings will not propagate to the child instance. 
You 
+# will need to use the admin:change-opts command for that.
 #
 if [ "x$JAVA_MIN_MEM" = "x" ]; then
     JAVA_MIN_MEM=128M
{code}

WDYT?
                
> admin script does not pass on JAVA_OPTS to instance
> ---------------------------------------------------
>
>                 Key: KARAF-1241
>                 URL: https://issues.apache.org/jira/browse/KARAF-1241
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 2.2.5
>         Environment: apache-karaf-2.2.5.tar.gz
>            Reporter: Jonathan Anstey
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 2.2.6, 3.0.0
>
>         Attachments: KARAF-1241.patch
>
>
> The JAVA_OPTS set in the bin/admin script are passed on to the admin process 
> but then when the admin process kicks off a new Karaf instance, the options 
> get lost. For example, when setting the max JVM memory to 1024M as follows:
> {code}
> [janstey@duffman apache-karaf-2.2.5]$ export JAVA_MAX_MEM=1024M
> {code}
> You can see that the default of 512M is still used for the Karaf instance:
> {code}
> [janstey@duffman apache-karaf-2.2.5]$ ./bin/admin start root
> [org.apache.karaf.admin.internal.InstanceImpl] : Starting instance root with 
> command: /opt/jdk1.6.0_23/jre/bin/java -server -Xmx512M 
> -Dcom.sun.management.jmxremote  
> -Djava.util.logging.config.file="/opt/fuse/apache-karaf-2.2.5/etc/java.util.logging.properties"
>  
> -Djava.endorsed.dirs="/opt/jdk1.6.0_23/jre/jre/lib/endorsed:/opt/jdk1.6.0_23/jre/lib/endorsed:/opt/fuse/apache-karaf-2.2.5/lib/endorsed"
>  
> -Djava.ext.dirs="/opt/jdk1.6.0_23/jre/jre/lib/ext:/opt/jdk1.6.0_23/jre/lib/ext:/opt/fuse/apache-karaf-2.2.5/lib/ext"
>  -Dkaraf.home="/opt/fuse/apache-karaf-2.2.5" 
> -Dkaraf.base="/opt/fuse/apache-karaf-2.2.5" -Dkaraf.startLocalConsole=false 
> -Dkaraf.startRemoteShell=true -classpath 
> /opt/fuse/apache-karaf-2.2.5/lib/karaf.jar:/opt/fuse/apache-karaf-2.2.5/lib/karaf-jaas-boot.jar
>  org.apache.karaf.main.Main
> {code}
> Attaching a fix shortly.

--
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


Reply via email to