Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Passing JVM option -Xss via JNI

2753581Sep 21 2016 — edited Sep 21 2016

Hi all,

I use the JVM option -Xss to run Java code that eats a lot of stack,

This works great on the command line:

   java  -cp  .  -Xss2m  eatstack

Without the -Xss2m it runs on a java.lang.StackOverflowError.

Now I want to execute the same Java class via JNI, so I add -Xss2m as

an option in the JavaVMInitArgs options list. I know it SEES the option, because

when I misspell it, the JVM prints a clear error, e.g.

   Invalid thread stack size: -Xss2n

However it seems to completely ignore the value, because whatever I supply,

I get a stack overflow. Tested this with Java 1.8, 1.7. and 1.6, all the same.

With Java 1.5 however it works ! That version is 1.5.0_22-b03.

I could not find any mention of this in the bug database or on Google.

Would this be a bug or perhaps a feature ? Any ideas appreciated.

Cheers,

Chris Breemer

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2016
Added on Sep 21 2016
2 comments
570 views