[INTDIST-20] When starting karaf with arguments meant for jvm they are ignored Created: 12/Nov/14 Updated: 03/May/18 Resolved: 19/Nov/16 |
|
| Status: | Resolved |
| Project: | integration-distribution |
| Component/s: | Karaf |
| Affects Version/s: | unspecified |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Tomas Cere | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 2367 |
| Description |
|
When starting karaf with f.ex. the flags are ignored. You can see them when running ps aux but they dont get through to the jvm so it runs without them. It's possible to set the memory flags in setenv script but the others are ignored silently. |
| Comments |
| Comment by Luis Gomez [ 13/Nov/14 ] |
|
Hi Tomas, In general you can use JAVA_OPTS environment variable to pass any jvm setting and flag: export JAVA_OPTS="-Xmx4096m -XX:MaxPermSize=512m" Please let me know if it does not work. BR/Luis |
| Comment by Jozef Behran [ 10/Dec/14 ] |
|
The "standard way" to pass options to the JVM is: JAVA_OPTS="-Xmx2G -XX:MaxPermSize=256M -XX:+PrintGCDetails -Xloggc:gc.log" bin/start The bin/karaf (which is invoked by bin/start) seems to be written in a manner that it takes whatever JAVA_OPTS are stated by the user on the command line. Unfortunately it does not have the feature of parsing its command line, recognizing options meant for the JVM and adding these to JAVA_OPTS. However things might break down a bit sometimes. If the Java options are still ignored or you cannot use such a command for whatever reason, then you need to edit bin/karaf to add that stuff into JAVA_OPTS just before Java is launched (at or around lines 415). |
| Comment by Vratko Polak [ 17/Dec/14 ] |
|
> In general you can use JAVA_OPTS environment variable to pass any jvm There is a danger in using JAVA_OPTS. bin/karaf (perhaps called by bin/start) does import default memory options from bin/setenv, but only if JAVA_OPTS environment variable is undefined (or empty). That means, if you specify -Xmx in JAVA_OPTS, you also have to specify -XX:MaxPermSize=512M, otherwise you end up with (generally too low) JVM default value (instead of ODL specified one). |