This discussion is archived
1 2 Previous Next 17 Replies Latest reply: Sep 7, 2011 1:31 PM by jschellSomeoneStoleMyAlias Go to original post RSS
  • 15. Re: JNI_CreateJavaVM on linux destroys stack???
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    user10623291 wrote:
    Huh? Ditch JNI test?
    If the limit is caused by how threads work on the OS then it has nothing to do with JNI nor Java.

    That can be tested by writing a C/C++ program.
  • 16. Re: JNI_CreateJavaVM on linux destroys stack???
    691149 Newbie
    Currently Being Moderated
    I'm not sure what you are talking about. Doesn't look like it has anything to do with my issue. Anyway, here are my bottom-line findings:

    1. On Solaris, both before and after creating the JVM the native stack limit is appears to be whatever ulimit -s. In my case it's 8MB.
    2. On Linux, before cresting the JBM the stack limit is ulimit -s, in my case 10MB. After creating the JVM however, it seems to be reduced to whatever is specified by -Xss (up to two MB).
    3. Even though -Xss may specify a larger limit than 2MB the native stack size is clipped to 2 MB.


    Also, reducing that stack usage in my application below 2MB no longer seems so unrealistic. It turned out we rarely reach 2MB, most of the time staying below 1MB. So, especially given no viable alternatives, this is what we are going to do.

    Edited by: user10623291 on Sep 4, 2011 12:14 PM
  • 17. Re: JNI_CreateJavaVM on linux destroys stack???
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    user10623291 wrote:
    I'm not sure what you are talking about. Doesn't look like it has anything to do with my issue.
    The links that you posted says that the problem originates with the operating system and with the thread implementation on the operating system.

    Nothing in the above has anything to do with java nor jni.

    It was further suggested that those links might be out of date.

    It is simple using C/C++ to create a program that demonstrates if the problem still exists on the operation system and with the thread library. Again that has nothing to do with java nor jni.

    If one can create a C/C++ program that demonstrates it then it proves that it currently is still a problem with the OS. And thus, excluding that you yourself re-writing the thread library, your only solution is to find another way to code your solution.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points