Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Controlling Java Heap Size Memory Allocation
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Deepak Kumar
Controlling Java Heap Size Memory Allocation
1 Answer(s)      4 years and a month ago
Posted in : Java Beginners


Hi,

Tell me about Controlling Java Heap Size Memory Allocation?

I have to run java program from console and allocate 2GB of RAM to Java Heap Size.

Thanks


Advertisement
View Answers

December 19, 2010 at 10:36 AM


Hi,

You can use the following command while running your java program:

java -Xmx2048m -classpath ".:${THE_CLASSPATH}" MyPrgoram

Here is the help of X option with Java:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\deepak>java -X
    -Xmixed           mixed mode execution (default)
    -Xint             interpreted mode execution only
    -Xbootclasspath:<directories and zip/jar files separated by ;>
                      set search path for bootstrap classes and resources
    -Xbootclasspath/a:<directories and zip/jar files separated by ;>
                      append to end of bootstrap class path
    -Xbootclasspath/p:<directories and zip/jar files separated by ;>
                      prepend in front of bootstrap class path
    -Xnoclassgc       disable class garbage collection
    -Xincgc           enable incremental garbage collection
    -Xloggc:<file>    log GC status to a file with time stamps
    -Xbatch           disable background compilation
    -Xms<size>        set initial Java heap size
    -Xmx<size>        set maximum Java heap size
    -Xss<size>        set java thread stack size
    -Xprof            output cpu profiling data
    -Xfuture          enable strictest checks, anticipating future default
    -Xrs              reduce use of OS signals by Java/VM (see documentation)
    -Xcheck:jni       perform additional checks for JNI functions
    -Xshare:off       do not attempt to use shared class data
    -Xshare:auto      use shared class data if possible (default)
    -Xshare:on        require using shared class data, otherwise fail.

The -X options are non-standard and subject to change without notice.

C:\Documents and Settings\deepak>

Thanks



Related Tutorials/Questions & Answers:
Controlling Java Heap Size Memory Allocation
Controlling Java Heap Size Memory Allocation  Hi, Tell me about Controlling Java Heap Size Memory Allocation? I have to run java program from console and allocate 2GB of RAM to Java Heap Size. Thanks   Hi, You can
Java memory allocation
Java memory allocation  How does Java allocate stack and heap memory
Advertisements
Java Memory allocation - Java Interview Questions
Java Memory allocation  By default what is the memory allocation size for a single class? How the memory is allocated? Based on what procedure
Java get Heap Size
Java get Heap Size       In this section, we are going to illustrates you how to obtain the heap size. The heap is the area in the memory used for memory storage during
heap memory
heap memory  how long is the object stored in heap memory persist
memory allocation
memory allocation   class Bird { { System.out.print("b1 "); } public Bird() { System.out.print("b2 "); } } class Raptor extends Bird { static... of execution of statement ? memory allocation ?  The code uses static
memory allocation
memory allocation  If we assign memory malloc(5) and access more than the assigned memory then what will happen? 1.segmentation error 2.memory leak 3.program will not compile 4.Your view
java memory allocation for member variables and member functions
java memory allocation for member variables and member functions  ... an object q of test class then when shall the memory be allotted for function fun...() that has three variables a=5,b=6.My questions are 1>When will the memory be allotted
Memory Allocation
Memory Allocation  What Is The Order Of Execution Of Statement 1) Statement Enclosed in {}. 2) Static 3) Public Static Void Main()   When jvm loads a class, static block is executed first, then main method. And at last
heap memory in j2me
heap memory in j2me  how to get j2me heap memory size
heap and stack memory
heap and stack memory   hi i am jane pls explain the difference between heap memory and stack memory with example programs
heap and stack memory
heap and stack memory   hi i am jane pls explain the difference between heap memory and stack memory   STACK memory... after v came out from the program]. While HEAP memory is referred as permanent
increase the JVM's maximum heap size. - Java Server Faces Questions
increase the JVM's maximum heap size.  Hi Friends ... How to increase the JVM's maximum heap size. Just now i am getting error like : Internal compiler error :java.lang.OutOfMemoryError give me any sugg.. Thanks
hw to increazse heap size in my eclipse
hw to increazse heap size in my eclipse   how can i increase heap size using my eclipse
Java heap space
options available to change Heap Size. 1 -Xms<size> set initial Java heap size 2 -Xmx<size> set maximum Java heap size 3 -Xss<size> set java thread stack size For example, you can set minimum heap to 64
Memory - Java Beginners
Memory management in Java  Where are these Heap and Stack? Is there size fixed? what is core area in memory
Java Heap
Java Heap       The JVM's heap stores all the objects generating by a running Java program. Java uses the new operator to create objects and memory for new objects is allocated
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space  Hi, How to resolve java.lang.OutOfMemoryError: Java heap space error. This error is coming while...: Java heap space where there is no more space available for the Java program
Java Get Memory
can easily learn it. In this Java Get Memory Size example, we have created.... Code to Get Memory Size in Java public class Memory {     public static void... Java Get Memory      
Array in Java
An Array is the static memory allocation that holds a fixed number of values of same type in memory. The size or length of an array is fixed when the array.... Different types of array used in Java are One-dimensional, Two-dimensional and multi
heap sort in java
heap sort in java  plz modify this program so that it can take input as integers and string both..... public class heap_Sort{ public static void...("\n Heap Sort\n---------------\n"); System.out.println("\n Unsorted Array\n\n
Memory
Memory   what is the different between heap memory and stack memory ? please explain with example
java heap space & netbeans - Java Beginners
java heap space & netbeans  Java heap space". I'm using netbeans 5.1.1 and jdk1.5.0_07 version.. can any body say how can i know the amount of java heap space while i run...java heap space & netbeans Hey,all!! I've got a problem
memory
memory   hi i am jane pls explain the difference between heap memory and stack memory
Java memory leak
Java memory leak  What is memory leak
using java.lang.OutOfMemoryError: Java heap space
using java.lang.OutOfMemoryError: Java heap space  i wrote a program... and my program has this error "using java.lang.OutOfMemoryError: Java heap space... is of size : " + filesizeInKB + " KB"); if(t1.isAlive()==false
Heap Sort in Java
Heap Sort in Java is used to sort integer values of an array. Like quicksort.... Example of Heap Sort in Java: public class eap_Sort{ public static void main...\sorting>Javac heap_Sort.java C:\array\sorting>java heap_Sort Heap Sort
Creating a memory leak with Java
Creating a memory leak with Java  Creating a memory leak with Java
java heap space bpbroble - Java Beginners
java heap space bpbroble  In my code i use JXmapViewier to show location on map but but after some time (When code is running )It give me exception that Java heap space problem how to solve that one or why this problem occurs
Heap Sort in Java
Heap Sort in Java      ..._Sort.java C:\array\sorting>java heap_Sort Heap Sort... are going to sort integer values of an array using heap sort. There are two types
Java memory optimization
Java memory optimization  When you think about optimization, what..., You can use memory dump and then analyze it to find the process/java code in your program which is using large amount of memory. Ideally java should garbage
 

 

 

DMCA.com