Re: How to display the current In-Use Stack Size

2019-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Lance, On 3/4/19 10:49, Campbell, Lance wrote: > Tomcat 9.x Note that the answer to this is not Tomcat-specific. > What is the easiest way to identify how much memory Tomcat/Java is > currently using from the Java stack -Xss ? Not max but

Re: How to display the current In-Use Stack Size

2019-03-04 Thread John Dale
Something like this maybe? String[] cmd = { "/bin/sh", "-c", "ps -eo rss,comm --sort rss" }; Process p = Runtime.getRuntime().exec(cmd); p.waitFor(); BufferedReader buf = new BufferedReader(new InputStreamReader( p.getInputStream())); String line = ""; String

Re: How to display the current In-Use Stack Size

2019-03-04 Thread Campbell, Lance
I have seen those as well. I was hoping someone knew if there was a way to view the Java Stack in particular. On 3/4/19, 11:16 AM, "John Dale" wrote: I found this in some old code .. not sure if it works. Let me know. //Getting the runtime reference from system

Re: How to display the current In-Use Stack Size

2019-03-04 Thread John Dale
I found this in some old code .. not sure if it works. Let me know. //Getting the runtime reference from system Runtime runtime = Runtime.getRuntime(); //Print used memory out.println("Used Memory: " + ((runtime.totalMemory() -

How to display the current In-Use Stack Size

2019-03-04 Thread Campbell, Lance
Tomcat 9.x What is the easiest way to identify how much memory Tomcat/Java is currently using from the Java stack -Xss ? Not max but currently being used. Is there a particular statement I can put into a servlet to see what the current memory usage is of the stack? Thanks, Lance