How to read max stack size -Xss that is set/default for a java program?


 
Thread Tools Search this Thread
Top Forums Programming How to read max stack size -Xss that is set/default for a java program?
# 1  
Old 06-25-2011
Question How to read max stack size -Xss that is set/default for a java program?

I need to know what is the maximum stack size i.e. -Xss my java program is running with.

Is there a way to find that out from inside my java program code and outside of it.

What i am looking for is to read whatever the current set max limit -Xss (stack sie) is for a particular JVM(not Operating System) i.e. PID; be it default or set explicitly using -Xss parameter, from inside a unix shell script or a java program inorder to setup a monitoring alert script.
A third-party tool may also come handy only if we can use its API inorder to read the stack size inside the unix shell script or a java program.

Kindly help !!!

Regards,
Mohtashim

---------- Post updated at 08:28 PM ---------- Previous update was at 02:52 AM ----------

Quote:
Originally Posted by mohtashims
I need to know what is the maximum stack size i.e. -Xss my java program is running with.

Is there a way to find that out from inside my java program code and outside of it.

What i am looking for is to read whatever the current set max limit -Xss (stack sie) is for a particular JVM(not Operating System) i.e. PID; be it default or set explicitly using -Xss parameter, from inside a unix shell script or a java program inorder to setup a monitoring alert script.
A third-party tool may also come handy only if we can use its API inorder to read the stack size inside the unix shell script or a java program.

Kindly help !!!

Regards,
Mohtashim
Ooops ... Did I post this in the wrong forum, or we do not have answers on this yet ?

---------- Post updated at 08:28 PM ---------- Previous update was at 08:28 PM ----------

Quote:
Originally Posted by mohtashims
I need to know what is the maximum stack size i.e. -Xss my java program is running with.

Is there a way to find that out from inside my java program code and outside of it.

What i am looking for is to read whatever the current set max limit -Xss (stack sie) is for a particular JVM(not Operating System) i.e. PID; be it default or set explicitly using -Xss parameter, from inside a unix shell script or a java program inorder to setup a monitoring alert script.
A third-party tool may also come handy only if we can use its API inorder to read the stack size inside the unix shell script or a java program.

Kindly help !!!

Regards,
Mohtashim
Ooops ... Did I post this in the wrong forum, or we do not have answers on this yet ?

---------- Post updated at 08:28 PM ---------- Previous update was at 08:28 PM ----------

Quote:
Originally Posted by mohtashims
I need to know what is the maximum stack size i.e. -Xss my java program is running with.

Is there a way to find that out from inside my java program code and outside of it.

What i am looking for is to read whatever the current set max limit -Xss (stack sie) is for a particular JVM(not Operating System) i.e. PID; be it default or set explicitly using -Xss parameter, from inside a unix shell script or a java program inorder to setup a monitoring alert script.
A third-party tool may also come handy only if we can use its API inorder to read the stack size inside the unix shell script or a java program.

Kindly help !!!

Regards,
Mohtashim
Ooops ... Did I post this in the wrong forum, or we do not have answers on this yet ?
# 2  
Old 06-26-2011
Add a JMX remote stanza to your start up script, you can then connect with JConsole which will give you all the start up options the JVM is running with. If there is no -Xss setting the default is 512K for Solaris and 1M for Linux and this will apply in the absence of an explicit setting.

Last edited by Skrynesaver; 06-26-2011 at 06:33 AM.. Reason: Wrong TLA
# 3  
Old 06-26-2011
Question

Quote:
Originally Posted by Skrynesaver
Add a JMX remote stanza to your start up script, you can then connect with JConsole which will give you all the start up options the JVM is running with. If there is no -Xss setting the default is 512K for Solaris and 1M for Linux and this will apply in the absence of an explicit setting.
SkryneSaver Hi,

Thanks for your inputs here. Can you give me specifics of the JMX remote stanza. Also I wish to read the Xss value inside a unix shell script or a java program. It will be more than help if you could let me know how-to.
# 4  
Old 06-27-2011
Sun have extensive docs on monitoring a process, JConsole isn't amenable to being scripted unfortunately
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Cannot set 'soft limits' for 'maximum stack size' for a standard user

Hi Guys, I'm trying to install Oracle Database on to Oracle Linux 7.6 but when the database install package checks the OS set-up, it keeps on failing on the soft limits for the stack. It's default value is 8192 but I'm trying to set it to 10240. This is what I added to... (2 Replies)
Discussion started by: ASGR
2 Replies

2. Shell Programming and Scripting

Java stack trace parser in awk

I want the developers to get a mail with Java stack traces on a daily bases. When something is flaged as known issue and will get a fix but mean while this does not need to get sent each dayl. This is what I got so far. It's a bash script that runs some AWK in it. To get the files that needs to... (6 Replies)
Discussion started by: chipmunken
6 Replies

3. UNIX for Dummies Questions & Answers

[SOLVED] How to set a default of 200000 as scrollback size in Putty ?

Putty release : 0.61 For saved sessions , you can configure Scrollback size just once using "Lines of Scrollback" in the 'Window' menu For a non-saved session (an ad-hoc session ) , If you want a higer scrollback size for a putty session , you have to set the "Lines of Scrollback" manually... (4 Replies)
Discussion started by: kraljic
4 Replies

4. Programming

Threads and stack size

Can someone explain me, why when I create new threads with stack bigger than default (using pthread_attr_setstacksize()) i can create more? Each thread has it's own stack, so how bigger stack can cause possibility to create more threads? (7 Replies)
Discussion started by: dawwin
7 Replies

5. Programming

Set host default gateway in C program.

Hello everybody, I'm having troubles on setting the default gateway address (and other addresses, such as netmask, or ip) of the host running a C program. I know it has to be with ioctl, but don't know how to do it. Could somebody give me an example on how to set the default gateway address of... (4 Replies)
Discussion started by: semash!
4 Replies

6. Solaris

How to set stack for Oracle's user?

Hi all! I've got a problem. Primary: Sun Sparc V890, 64bit Standby: HP-Proliant ML 350, 64bit In the machine that I've got configured physical standby database, the alert_log_file point me one error: Sat Feb 28 00:40:08 2009 ORA-00202: control file:... (5 Replies)
Discussion started by: trantuananh24hg
5 Replies

7. UNIX for Advanced & Expert Users

Max. file size

i want to know what is the maximum file size supported by linux with ext3 file system. (1 Reply)
Discussion started by: nagalenoj
1 Replies

8. UNIX for Advanced & Expert Users

Stack size of Apps ?

hi all, I need to find out the Stack usage of an App which is basically an mpeg4 decoder. We are plannin to port the codec to an RTOS. so is there any way to find out the max stack size while the codec is running? saTs (1 Reply)
Discussion started by: satish_somu
1 Replies

9. UNIX for Dummies Questions & Answers

Max I/O Size

My HP-UX 11.0 system is supporting an Oracle database. I have found a number of references on the Net to the "Max I/O size" in relation to setting Oracle parameters. How can I tell what my max i/o size is? I originally made the assumption that it was referring to my stripe size but now I think... (1 Reply)
Discussion started by: keelba
1 Replies

10. Programming

How to increase the size of the stack

Hi!!, could someone tell me how to increase the stack size in HP-UX? Thanx (7 Replies)
Discussion started by: jyotipg
7 Replies
Login or Register to Ask a Question