B
bernd
Hi folks,
my application polls a SysV-message queue from within a thread (class
Mqueue extending Thread). The queue is polled repeatedly using a
native function (which is basically a java-port of msgrcv()). Between
two polling actions I wait a few hundred milliseconds using
Thread.sleep( pollint ) ; # within Mqueue.run()
poll_int being the number of milliseconds which should elapse after an
invocation of the polling function.
If the number of messages which are sent over the IPC-queue is not too
high (up to 100 messages), i.e., if the sending procress does not last
too long, everything works fine, but if a higher number of messages is
generated the application hangs and sometimes it crashes with the
following error message:
Exception in thread "CompilerThread0" java.lang.OutOfMemoryError:
requested 32756 bytes for ChunkPool::allocate. Out of swap space?
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at IPC.MQueue.run(MQueue.java:253)
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at IPC.MQueue.run(MQueue.java:253)
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at IPC.MQueue.run(MQueue.java:253)
Exception in thread "CompilerThread1" java.lang.OutOfMemoryError:
requested 32756 bytes for ChunkPool::allocate. Out of swap space?
My questions to the experts now:
1. Is it just by chance that (and possibly due to the “waiting” nature
of the sleep-Thread) that the interruption occurs during the sleep()
or does this point to a too high number of threads in my application
which lead to the memory leak?
2. Up to now I did not explicitly stop() any thread in my application.
Is this strictly necessary or may I rely on the GC to not run into
trouble with too a high number of threads? Is it possible to destroy
the Mqueue-object, which from my point of view is the possible
originator of the leak, after it is not used any more to avoid the
leak?
3. How do I find out the exact reason for the memory leak? I am just
speculating concerning the threads being the reason for the problem.
Is this possible by only using the JVM and appropriate command line
option?
4. Is it worth to play around with the –Xmx option of the JVM?
Cheers
Bernd
my application polls a SysV-message queue from within a thread (class
Mqueue extending Thread). The queue is polled repeatedly using a
native function (which is basically a java-port of msgrcv()). Between
two polling actions I wait a few hundred milliseconds using
Thread.sleep( pollint ) ; # within Mqueue.run()
poll_int being the number of milliseconds which should elapse after an
invocation of the polling function.
If the number of messages which are sent over the IPC-queue is not too
high (up to 100 messages), i.e., if the sending procress does not last
too long, everything works fine, but if a higher number of messages is
generated the application hangs and sometimes it crashes with the
following error message:
Exception in thread "CompilerThread0" java.lang.OutOfMemoryError:
requested 32756 bytes for ChunkPool::allocate. Out of swap space?
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at IPC.MQueue.run(MQueue.java:253)
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at IPC.MQueue.run(MQueue.java:253)
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at IPC.MQueue.run(MQueue.java:253)
Exception in thread "CompilerThread1" java.lang.OutOfMemoryError:
requested 32756 bytes for ChunkPool::allocate. Out of swap space?
My questions to the experts now:
1. Is it just by chance that (and possibly due to the “waiting” nature
of the sleep-Thread) that the interruption occurs during the sleep()
or does this point to a too high number of threads in my application
which lead to the memory leak?
2. Up to now I did not explicitly stop() any thread in my application.
Is this strictly necessary or may I rely on the GC to not run into
trouble with too a high number of threads? Is it possible to destroy
the Mqueue-object, which from my point of view is the possible
originator of the leak, after it is not used any more to avoid the
leak?
3. How do I find out the exact reason for the memory leak? I am just
speculating concerning the threads being the reason for the problem.
Is this possible by only using the JVM and appropriate command line
option?
4. Is it worth to play around with the –Xmx option of the JVM?
Cheers
Bernd