participate


HotSpot Internals - Understanding Xss- java stack internals
<<   Back to Forum  |   Give us Feedback
10 Duke Stars available
This topic has 2 replies on 1 page.
rhe
Posts:10
Registered: 7/28/06
Understanding Xss- java stack internals   
Jul 30, 2006 10:17 PM

 
Cross posting from
http://forum.java.sun.com/thread.jspa?threadID=756193

I am using jdk 1.4.2.07 and run into the following error with the VM crashing with a defunct process:"Fatal: Stack size too small. Use 'java -Xss' to increase default stack size." on Linux. Does this imply a JVM bug given that this happens only when the VM attempts to launce a large number of threads (Tomcat).

It looks like in the absence of the Xss VM parameter, the JVM picks up the stack size based on the Linux process limits. In my case it was set to 2048k. Why would the VM crash when starting more than a threshold number of threads? My assumption is that the VM allocates the stack size to every thread. As the number of threads launched by the VM were to increase, there would be a state in which the VM would not be able to acquire more memory from the system. I have tried the latest version of the JDK 1.4.2 but it did not help either.

Any suggestions?

Thanks
 
kakvicky
Posts:2
Registered: 10/6/05
Re: Understanding Xss- java stack internals   
Aug 21, 2006 4:09 AM (reply 1 of 2)  (In reply to original post )

 
I am using jdk 1.4.2.07 and run into the following
error with the VM crashing with a defunct
process:"Fatal: Stack size too small. Use 'java -Xss'
to increase default stack size." on Linux. Does this
imply a JVM bug given that this happens only when the
VM attempts to launce a large number of threads
(Tomcat).
No this is not the bug but the limitation , the default is 8k ....

It looks like in the absence of the Xss VM
parameter, the JVM picks up the stack size based on
the Linux process limits. In my case it was set to
2048k. Why would the VM crash when starting more
than a threshold number of threads? My assumption is
that the VM allocates the stack size to every thread.
As the number of threads launched by the VM were to
increase, there would be a state in which the VM
would not be able to acquire more memory from the
system. I have tried the latest version of the JDK
1.4.2 but it did not help either.
Actually there will be the limit of threads that the process can span , if you cross tha limit the OS will throw the error which eventaully will be thrown by the JVM ....
Read this
http://forum.java.sun.com/thread.jspa?forumID=37&threadID=202978
Thread limit for a process can be changed , you got to change the configuration files , I dont remember the precise files and enteries ....
 
rhe
Posts:10
Registered: 7/28/06
Re: Understanding Xss- java stack internals   
Aug 21, 2006 11:08 PM (reply 2 of 2)  (In reply to #1 )

 
No this is not the bug but the limitation , the default is 8k ....
What is the default 8K? I was under the impression the stack size defaulted to the max as limited by ulimit unless specified via Xss JVM option. When i check using pmap, the stack shows up as 32K whatever be the Xss value.

Actually there will be the limit of threads that the process can span , if >>you cross tha limit the OS will throw the error which eventaully will be >>thrown by the JVM ....
Thread limit for a process can be changed , you got to change the >>configuration files , I dont remember the precise files and enteries ....
I think in my case the number of threads being spawned is being limited by the heap size allocated to the VM. In a test program i noticed that as i reduced the heap allocated to the JVM, the number of threads that the JVM could spawn increased. I checked the process limits and they seemed to be higher than what would be expected.

Thanls
 
This topic has 2 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 28
  • Guests : 129

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums