Link to home
Start Free TrialLog in
Avatar of DevSupport
DevSupport

asked on

How to find Tomcat initial memory and Max memory through command line windows

Hi,
We have the tomcat variables set in the tomcatw.exe  JAVA options on windows, but I want to get the Java Initial memory and Java Max memory settings results in command line.

I tried jinfo -flags pid and catalina.exe version

Please help me with the command to get the initial memory and max memory pool settings of a tomcat instance.

Thanks
Avatar of DevSupport
DevSupport

ASKER

I am attaching the screenshots of the values which I am trying to retrieve through command line in windows, if my question is not clear enough.

Any help would be highly appreciated!.

Thanks
xmx-and-xms-settings-of-tomcat.jpg
May I know why this question is neglected? Is there no way to accomplish this? or is my question not clear enough?

Thanks
Avatar of rrz
I have been listening. I don't have a solution. I do wonder if you know about Tomcat's pre-installed manager app ? If you click on the "Server Status" button on Tomcat's home page, then you will see memory usage info(if you entered name and password in tomcat-users.xml file). Although that proves that the info can be obtained programmatically, I don't know how it is done.  I realize that you wanted to access the info on command line. I don't know about that.
Hi,

Give it a try with wmic + find command.

wmic process | find "java" | find "catalina"

Open in new window


I tried in my computer (on Win 7) and i can able to get the information (refer attached snap).

Basically, please play with wmic process command and check the list of processes it displays. Then
You may need to add more text to find specific (tomcat) process from the list if you multiple java processes are running.

Hope it helps.
I tried it in a single java application instance with tomcat 8 and its not working
On a command window, can run below command (by keeping tomcat running) and share generated text file ?

wmic process >> processes.txt
Please find attached result. I took this while tomcat is running as a service.
Seems you missed to attach a file.
Sorry! Here it is.

Thanks
processes-results.txt
ASKER CERTIFIED SOLUTION
Avatar of Roger Wilko
Roger Wilko

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The response from Roger worked really well for my requirement. Thank You!