से अधिक है मैंने Out Of Memory help from sun's site का उपयोग किया था। मैंस्मृति से बाहर अनुकरण कैसे करें: अनुरोधित सरणी आकार VM सीमा
javac *.java;java -Xmx256m JavaTest
लेकिन इसके बाद के संस्करण लाइन
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at JavaTest.main(JavaTest.java:7)
उत्पादन के साथ अपने मशीन पर द्वारा
import java.util.ArrayList;
import java.util.List;
public class JavaTest {
public static void main(String[] args){
long[] ll = new long[64*1024*1024];
}
}
इस अनुकरण करने की कोशिश की है, जहां यह रूप में
Out Of Memory : Requested array size exceeds VM limit
This indicates that the application attempted to allocate an array that is larger than the heap size. For example, if an application tries to allocate an array of 512MB but the maximum heap size is 256MB, then this error will be thrown. In most cases the problem is likely to be either that the heap size is too small or that a bug results in the application attempting to create an array whose size is calculated to be incorrectly huge.
उद्धृत किया गया है क्या क्या मैं याद कर रहा हूँ
अद्यतन: मेरे जावा संस्करण है
$java -version java version "1.6.0_15" Java(TM) SE Runtime Environment (build 1.6.0_15-b03) Java HotSpot(TM) Server VM (build 14.1-b02, mixed mode)
धन्यवाद। यह भी मेरे लिए काम कर रहा है। लेकिन मेरे कोड ने पहले क्यों काम नहीं किया? – DKSRathore
ठीक है।तो मेरा सिस्टम इस अपवाद को 1024 * 1024 * 1024-2 की सीमा में Integer.MAX_VALUE – DKSRathore
@Adrian तक बना रहा है, मैं अपनी वीएम सीमा कैसे जानूं? – DKSRathore