Checking heap memory size for java app


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Checking heap memory size for java app
# 1  
Old 07-16-2010
Checking heap memory size for java app

Hi

I have one Java application installed in my Solaris system. Is there a way to find out the heap memory allocated size/used size/free size for the particular Java process?

If anyone knows the command, please let me know. Even I appreciate if I have any scripts to find out the same.

Regards,
Thiru
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Sudden rise in heap memory of a process

Hi, There is a abrupt memory rise observed for a process on solaris. When the process is started the memory is around 268 MB and is stable for a day. Then suddenly the memory increased to 4364 MB. Below is the pmap -xs output for the process (only for heap) Address Kbytes ... (1 Reply)
Discussion started by: Nidds
1 Replies

2. Programming

find size of heap allocated

I want to find the size of the total memory allocated on the heap for the following statement: int* a = new int;How can I use the sizeof operator for this? I used: printf("\t===> %d\n",sizeof(*a)); Is this statement correct? I have asked the question because when I checked the memory of... (13 Replies)
Discussion started by: rupeshkp728
13 Replies

3. Programming

can i have an optimal solution for this java code ? Facing Java heap space problem even at 3GB heaps

My desired output is run: for this 1 for this 2 for this 3 for this 4 for this 5 for this 1,2 1->2 for this 2,3 2->3 for this 3,4 3->4 for this 4,5 4->5 for this 1,2,3 1->2,3 (2 Replies)
Discussion started by: vaibhavkorde
2 Replies

4. Programming

Java code to access the shared heap

Hi Help needed and forgive me as I dont know Java so please bare with me. I have searched this site and google but was unable to locate the information I need. An application that we use - is based on java and stores some performance counters etc internally in the shared JVM. They are not... (4 Replies)
Discussion started by: frustrated1
4 Replies

5. Shell Programming and Scripting

Finding Heap size Command--Urgent

Hi Friends, i need a unix command to check the heap space availability on unix system as I am getting following error: Error occurred during initialization of VM Could not reserve enough space for object heap Error occurred during initialization of VM Could not reserve enough space for... (2 Replies)
Discussion started by: Anji
2 Replies

6. Shell Programming and Scripting

script to gather weblogic jvm heap size stats

Hello, has anyone written something that will monitor/gather weblogic heap info ? I need to gather size, high/low stats to a file that I can upload to a speadsheet thanks for your help! (2 Replies)
Discussion started by: galenw
2 Replies

7. AIX

AIX 5.3 Heap Memory with SAP

Any idea whether this parameter can be set / adjusted and where please? (3 Replies)
Discussion started by: johnf
3 Replies

8. UNIX for Advanced & Expert Users

monitor jvm heap size

I'm running websphere 4.5 on AIX 5 with java 1.3 and would like to find out the following: How much memory is allocated to each JVM, and how much of the allocated heap size is actually being used by a specific JVM? (0 Replies)
Discussion started by: rein
0 Replies

9. Filesystems, Disks and Memory

heap size for JVM!

Hi all, Thanks 'thehoghunter' and 'hugo' for the comments! I've to increase the size of the heap size for AIX 4.3.3. Now what's the command that I've and also is it something similar to growing the file system in Solaris (growfs) (1 Reply)
Discussion started by: i2admin
1 Replies

10. Filesystems, Disks and Memory

heap size!

I'm a new guy to this field and I'm learning a lot about UNIX! Can any explan to me what exactly does 'heap size' mean and how can i increase the size for AIX 4.3.3? (2 Replies)
Discussion started by: i2admin
2 Replies
Login or Register to Ask a Question
java(5) 							File Formats Manual							   java(5)

NAME
java, javac, jre, jdb, javah, javap, javadoc, appletviewer, rmic, rmiregistry, serialver, native2ascii, jar, javakey - The Java Develop- ment Kit tools SYNOPSIS
java [ options ] classname <args> java_g [ options ] classname <args> DESCRIPTION
This reference page describes the java command only. The Java Development Kit (JDK) is part of the Java Virtual Machine (VM). If the JDK documentation was installed on your Tru64 UNIX system, you can view documentation on all of the JDK tools, and other Java reference mate- rial, at the following location: /usr/share/doclib/java/index.html The java command invokes an interpreter that executes Java bytecodes. It executes Java class files created by a Java compiler, for instance, javac. NOTES
Any arguments that appear after classname on the command line are passed to the main method of the class. The java command expects the binary representation of the class to be in a file called classname.class, which is generated by compiling the corresponding source file with javac. All Java class files end with the filename extension .class which the compiler automatically adds when the class is compiled. classname must contain a main method defined as follows: class Aclass { public static void main(String argv[]){ . . . } } java executes the main method and then exits unless main creates one or more threads. If any threads are created by main then java doesn't exit until the last thread exits. Ordinarily, you compile source files with javac then run the program using java. However, java can be used to compile and run programs when the -cs option is used. As each class file is loaded its modification date is compared to the modification date of the class source file. If the source has been modified more recently, it is recompiled and the new class file is loaded. java repeats this procedure until all the classes are correctly compiled and loaded. The interpreter can determine whether a class is legitimate through the mechanism of verification. Verification ensures prior to their exe- cution that class files do not violate any language constraints. java_g is a non-optimized version of java suitable for use with debuggers like jdb. EXAMPLES
The classname argument is the name of the class to be executed. classname must be fully qualified by including its package in the name, for example: % java java.lang.String When you define your own classes you need to specify their location. Use CLASSPATH to do this. CLASSPATH consists of a colon separated list of directories that specifies the path. For example: .:/home/xyz/classes The system always appends the location of the system classes onto the end of the class path unless you use the -classpath option to specify a path. OPTIONS
Allows the Java debugger, jdb, to attach itself to this java session. When -debug is specified on the command line, java displays a pass- word which must be used when starting the debugging session. When a compiled class is loaded, this option causes the modification time of the class bytecode file to be compared to that of the class source file. If the source has been modified more recently, it is recompiled and the new class file is loaded. Specifies the path java uses to look up classes. Overrides the default or the CLASSPATH environment variable if it is set. Directories are separated by colons. Thus the general format for path is: .:<your_path> For example: .:/home/xyz/classes:/usr/local/java/classes Sets the maximum size of the memory allocation pool (the garbage collected heap) to x. The default is 16 megabytes of memory. x must be greater than or equal to 1000 bytes. By default, x is measured in bytes. You can specify x in either kilobytes or megabytes by appending the letter k for kilobytes or the letter m for megabytes. Sets the startup size of the memory allocation pool (the garbage collected heap) to x. The default is 1 megabyte of memory. x must be > 1000 bytes. By default, x is measured in bytes. You can specify x in either kilobytes or megabytes by appending the letter k for kilobytes or the letter m for megabytes. Turns off asynchronous garbage collection. When activated no garbage collection takes place unless it is explicitly called or the program runs out of memory. Normally garbage collection runs as an asynchronous thread in parallel with other threads. Turns off garbage collection of Java classes. By default, the Java interpreter reclaims space for unused Java classes during garbage collection. Prints the build version information. Prints a usage message. Each Java thread has two stacks: one for Java code and one for C code. The -ss option sets the maximum stack size that can be used by C code in a thread to x. Every thread that is spawned during the execution of the program passed to java has x as its C stack size. The default units for x are bytes. The value of x must be greater than or equal to 1000 bytes. You can modify the meaning of x by appending either the letter k for kilobytes or the letter m for megabytes. The default stack size is 128 kilobytes (-ss 128k). Each Java thread has two stacks: one for Java code and one for C code. The -oss option sets the maximum stack size that can be used by Java code in a thread to x. Every thread that is spawned during the execution of the program passed to java has x as its Java stack size. The default units for x are bytes. The value of x must be greater than or equal to 1000 bytes. You can modify the meaning of x by appending either the letter k for kilobytes or the letter m for megabytes. The default stack size is 400 kilobytes (-oss 400k). Prints a trace of the instructions executed (java_g only). Causes java to print a message to stdout each time a class file is loaded. Runs the verifier on all code. Runs the verifier on all code that is loaded into the sys- tem via a classloader. verifyremote is the default for the interpreter. Turns verification off. Causes the garbage collector to print out messages whenever it frees memory. Redefines a property value. propertyName is the name of the property whose value you want to change and newValue is the value to change it to. For example, this command line % java -Dawt.button.color=green ... sets the value of the property awt.button.color to "green". java accepts any number of -D options on the command line. ENVIRONMENT VARIABLES
Used to provide the system a path to user-defined classes. Directories are separated by colons, for example, .:/home/xyz/classes:/usr/local/java/classes SEE ALSO
If the JDK documentation was installed on your Tru64 UNIX system, you can view it at the following location: /usr/share/doclib/java/index.html delim off java(5)