<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JNI stack size issues in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748580#M33845</link>
    <description>Rick -&lt;BR /&gt;&lt;BR /&gt;It turns out that my assertion that the application "allocates a lot of memory on the stack" is false.  The highest stack usage I spotted after I create the JVM is only about 75K more than when it was created.  Some specifics:&lt;BR /&gt;  SP when I create the JVM: 2060787104&lt;BR /&gt;  SP when I call the java method: 2060790288&lt;BR /&gt;  min observed subsequent SP: 2060707616&lt;BR /&gt;  max observed subsequent SP: 2061100112&lt;BR /&gt;&lt;BR /&gt;The problem is reproducable, in that it occurs in every process that calls this function.  It doesn't always show up at the same spot, though.  Sometimes I can make several calls before it occurs, sometimes it happens after just one.  Sometimes it occurs when the process is active, sometimes when it is waiting for input from the terminal.  I'm guessing this variability is because it happens when the garbage collector runs.&lt;BR /&gt;&lt;BR /&gt;I have not tested this with Java 1.4.2, but I will try to do so.  This is complicated by the fact that my method uses RMI classes that were compiled on a Windows machine running 1.5.0.  In the past I've had trouble using classes compiled by a higher version of java.&lt;BR /&gt;&lt;BR /&gt;When I use -Xss2m the problem still occurs, though it does seem to take longer.  Wnen I use -Xss10m, I get this when I call the java method:&lt;BR /&gt;  Exception in thread "SeedGenerator Thread" java.lang.OutOfMemoryError&lt;BR /&gt;        at java.lang.Thread.start0(Native Method)&lt;BR /&gt;        at java.lang.Thread.start(Thread.java:574)&lt;BR /&gt;        at sun.security.provider.SeedGenerator$ThreadedSeedGenerator.run(SeedGenerator.java:282)&lt;BR /&gt;        at java.lang.Thread.run(Thread.java:595)&lt;BR /&gt;  pool_alloc: out of memory, file JDEV:[fastvm.srcjava.util]pool.c;1, line 117&lt;BR /&gt;  util_malloc: out of memory, file JDEV:[fastvm.srcjava.runtime]port.c;2, line 110&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;- Fletcher</description>
    <pubDate>Tue, 14 Mar 2006 11:11:20 GMT</pubDate>
    <dc:creator>Fletcher Curry</dc:creator>
    <dc:date>2006-03-14T11:11:20Z</dc:date>
    <item>
      <title>JNI stack size issues</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748578#M33843</link>
      <description>My application, written in BASIC and C, creates a Java Virtual Machine with JNI_CreateJavaVM, then periodically makes calls to a Java method.  Between these calls, it allocates a lot of memory on the stack, which I think is giving the JVM trouble.  My process aborts with this message:&lt;BR /&gt;&lt;BR /&gt;Assertion failed: sp &amp;gt;= ((char*) (t-&amp;gt;stackbase)) - MAX_STACK_SIZE, file JDEV:[fastvm.srcjava.sys.alpha]gcinit.c;4, line 464&lt;BR /&gt;&lt;BR /&gt;I have tried increasing Java's stack size with both -Xss and -XX:MainThreadStackSize.  -Xss resulted in OutOfMemoryErrors.  -XX:MainThreadStackSize had no noticeable effect.  Any ideas about what's going on here?  I'm using Java 1.5.0 on VMS 7.3-2.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;- Fletcher</description>
      <pubDate>Fri, 10 Mar 2006 08:58:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748578#M33843</guid>
      <dc:creator>Fletcher Curry</dc:creator>
      <dc:date>2006-03-10T08:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: JNI stack size issues</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748579#M33844</link>
      <description>Fletcher,&lt;BR /&gt;  I believe we used to see this error back in Java 1.3.1-x, I'll have to dig through my older correspondence to get the particulars on it.&lt;BR /&gt;&lt;BR /&gt;In the meantime, can you define what you mean by "it allocates a lot of memory on the stack"?  What is "a lot of memory"?&lt;BR /&gt;&lt;BR /&gt;Is the problem reproducable at will?&lt;BR /&gt;&lt;BR /&gt;Have you tested your code with Java 1.4.2-x and did you see the same failures that you are seeing with 1.5?&lt;BR /&gt;&lt;BR /&gt;In addition, what values are you using with the -Xss#### arguments on the java command-line?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Rick Retterer&lt;BR /&gt;HP Services&lt;BR /&gt;OpenVMS, Tru64 Java Support&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Mar 2006 11:40:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748579#M33844</guid>
      <dc:creator>Rick Retterer</dc:creator>
      <dc:date>2006-03-13T11:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: JNI stack size issues</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748580#M33845</link>
      <description>Rick -&lt;BR /&gt;&lt;BR /&gt;It turns out that my assertion that the application "allocates a lot of memory on the stack" is false.  The highest stack usage I spotted after I create the JVM is only about 75K more than when it was created.  Some specifics:&lt;BR /&gt;  SP when I create the JVM: 2060787104&lt;BR /&gt;  SP when I call the java method: 2060790288&lt;BR /&gt;  min observed subsequent SP: 2060707616&lt;BR /&gt;  max observed subsequent SP: 2061100112&lt;BR /&gt;&lt;BR /&gt;The problem is reproducable, in that it occurs in every process that calls this function.  It doesn't always show up at the same spot, though.  Sometimes I can make several calls before it occurs, sometimes it happens after just one.  Sometimes it occurs when the process is active, sometimes when it is waiting for input from the terminal.  I'm guessing this variability is because it happens when the garbage collector runs.&lt;BR /&gt;&lt;BR /&gt;I have not tested this with Java 1.4.2, but I will try to do so.  This is complicated by the fact that my method uses RMI classes that were compiled on a Windows machine running 1.5.0.  In the past I've had trouble using classes compiled by a higher version of java.&lt;BR /&gt;&lt;BR /&gt;When I use -Xss2m the problem still occurs, though it does seem to take longer.  Wnen I use -Xss10m, I get this when I call the java method:&lt;BR /&gt;  Exception in thread "SeedGenerator Thread" java.lang.OutOfMemoryError&lt;BR /&gt;        at java.lang.Thread.start0(Native Method)&lt;BR /&gt;        at java.lang.Thread.start(Thread.java:574)&lt;BR /&gt;        at sun.security.provider.SeedGenerator$ThreadedSeedGenerator.run(SeedGenerator.java:282)&lt;BR /&gt;        at java.lang.Thread.run(Thread.java:595)&lt;BR /&gt;  pool_alloc: out of memory, file JDEV:[fastvm.srcjava.util]pool.c;1, line 117&lt;BR /&gt;  util_malloc: out of memory, file JDEV:[fastvm.srcjava.runtime]port.c;2, line 110&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;- Fletcher</description>
      <pubDate>Tue, 14 Mar 2006 11:11:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748580#M33845</guid>
      <dc:creator>Fletcher Curry</dc:creator>
      <dc:date>2006-03-14T11:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: JNI stack size issues</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748581#M33846</link>
      <description>These stack usage numbers made me realize that it's not actually a matter of my stack usage after I create the JVM, but my stack usage beforehand.  If I invoke the garbage collector from my java method, it fails on the first call.  Once I had come to this realization, I was able to write a simple example that demonstrates this behavior.  Source code for this example is in the attached JAR.  The COM file compiles, links, and runs the program.&lt;BR /&gt;&lt;BR /&gt;This program behaves the same under Java 1.4.2-3, 1.5.0-beta1, and 1.5.0-1.  Using the Fast VM, it fails when the garbage collector runs.  Using the Classic VM, it works fine.  This would seem to suggest a workaround: use the Classic VM.  Unfortunately, I have other code that fails with the Classic VM and only works with the Fast VM, so this is not an option.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;- Fletcher</description>
      <pubDate>Wed, 15 Mar 2006 12:12:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748581#M33846</guid>
      <dc:creator>Fletcher Curry</dc:creator>
      <dc:date>2006-03-15T12:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: JNI stack size issues</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748582#M33847</link>
      <description>Fletcher,&lt;BR /&gt;&lt;BR /&gt;  I have copied down the jar file, let me have a look at it and I'll get back to you on it.  I'm swamped at the moment, but I'll try to stay a little late and work on it for you.&lt;BR /&gt;&lt;BR /&gt;Thanks for putting it together, I was going to ask you if you had someway to reproduce the problem.  You read my mind.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Rick&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Mar 2006 13:11:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748582#M33847</guid>
      <dc:creator>Rick Retterer</dc:creator>
      <dc:date>2006-03-15T13:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: JNI stack size issues</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748583#M33848</link>
      <description>Fletcher,&lt;BR /&gt;  It's a bug in in Java for OpenVMS 1.4.2-x and 1.5-x.  &lt;BR /&gt;&lt;BR /&gt;It seems that the gcinit.c code limits the Stack Space for OpenVMS to only 1mb, while the Unix side of the assignments was setup for 1gb.&lt;BR /&gt;&lt;BR /&gt;Java engineering is aware of the problem, and will be fixing it in a upcoming release.&lt;BR /&gt;&lt;BR /&gt;To workaround the problem, you will need to create another thread to run your JVM stuff under.&lt;BR /&gt;&lt;BR /&gt;You will need to log a call to HP Support with the OpenVMS java team (Attention Rick Retterer Java Support) to officially report the problem and to receive a patched version of Java until the fix makes it into the next release available to the public.&lt;BR /&gt;&lt;BR /&gt;Sorry that you ran into this, it looks like it was an oversite that needs to be addressed by engineering.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Rick Retterer&lt;BR /&gt;HP Services&lt;BR /&gt;Java Support&lt;BR /&gt;Atlanta, GA.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Mar 2006 15:19:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748583#M33848</guid>
      <dc:creator>Rick Retterer</dc:creator>
      <dc:date>2006-03-15T15:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: JNI stack size issues</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748584#M33849</link>
      <description>Rick -&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.  I have some other processes aborting with the message:&lt;BR /&gt;&lt;BR /&gt;Assertion failed: s-&amp;gt;exc != NULL, file JDEV:[fastvm.srcjava.sys.alpha]einfo_vms.c;7, line 349&lt;BR /&gt;&lt;BR /&gt;Is it likely that this is another manifestation of the same problem?&lt;BR /&gt;&lt;BR /&gt;- Fletcher</description>
      <pubDate>Thu, 16 Mar 2006 09:27:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/jni-stack-size-issues/m-p/3748584#M33849</guid>
      <dc:creator>Fletcher Curry</dc:creator>
      <dc:date>2006-03-16T09:27:18Z</dc:date>
    </item>
  </channel>
</rss>

