Skip to Main Content

Java HotSpot Virtual Machine

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!

Trying to find right -Xss, -Xmx values for application using JNI

843811Nov 14 2001 — edited Dec 9 2003
I'm trying to find the "right" VM memory/stack settings for our application that uses JNI. We are using JDK 1.3.1_01, SunOS 5.7 (and/or NT4). The application engine written in C++ is both memory and computation intensive, the GUI is in Java. The 2 sides communicate through JNI.

What effect does these options have on the C++ side? I thought setting -Xmx to 1.4 G for NT and 2G for Solaris would allow our application to utilize all the resource. But I was told by our local Java guy that setting -Xmx too high would reduce the memory C++ side can use. But, isn't C++ side just a thread under JVM -> same process? Then, the amount of memory it can access is the address space (2G on a 32-bit machine). Increase the heap size would increase the memory the process can access? On the other hand, why increasing -Xss would prevent a recursive C++ function running out of stack? See my confusion? Larger -Xmx won't help C++ side but higher -Xss would.

What scares me is that the Java side of our application does depend on the C++ side in terms of the memory consumption. If we get this wrong, our application would die when our customers using it for the real thing. What is the guideline for setting these numbers? BTW, we typically set ulimit to unlimited for Solaris.

Please help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 6 2004
Added on Nov 14 2001
9 comments
1,516 views