from the perspective of language, java.util.List is an interface, under which there are multiple N implementations, the most commonly used are ArrayList and LinkedList and its various inheritance or synchronization implementation (such as Vector/Queue/Stack)
ArrayList inside is to take the array storage, then the upper limit is Integer.MAX_VALUE
LinkedList inside is a LinkedList, theoretically infinite
also, everything in the List is in memory (although you can implement one yourself), so how much you can put depends on the size and type of stuff you’re putting. The
size aspect is easy to calculate, if one object is 1K, then 400,000 will take up at least 400M memory (not counting other usage).
virtual machine memory classification, if it is a common object, generally use the Heap space, if it is a constant or something like string.intern (), then use the Permanent Generation.
in actual development, the default memory size of virtual machine varies according to different virtual machine implementations. The maximum heap size can be adjusted with -xmx when the application is launched, such as adjusting the maximum heap size to 2G:
java -Xmx2048m cn.gefostudio.App
adjust the maximum size of the immortal band to 1G:
java -XX:MaxPermSize=1024m cn.gefostudio.App
- JVM start error: could not reserve enough space for object heap error
- Yarn: runtime.ContainerExecutionException : launch container failed
- Error occurred during initialization of VM Could not reserve enough space for object heap
- Differences between Java stack overflow ror and outofmemoryerror
- EXSI6.0 virtual machine swap error causes it to fail to start
- Fatal IO error 11
- [Python error] memoryerror
- Error: could not create the Java virtual machine. Error: a fatal exception has occurred
- Outofmemoryerror: GC overhead limit exceeded solution
- java.util.Collections.max() [How to Use]
- Namenode startup error: outofmemoryerror: Java heap space
- Error report in idea compilation Error:Android Dex : [Project] java.lang.OutOfMemoryError : GC overhead limit exceeded
- LeetCode 332. Reconstruct Itinerary
- Python uses the priority queue to get the maximum k elements
- curl: (23)failed writing body(0!=3810)
- After compiling. Java, the following appears: Note:checkUser.java uses unchecked or unsafe operations.Note :Recompile with -Xlint :unchecked for details.
- Modify the VDI path of VirtualBox on MacOSX, and transfer the virtual machine
- Failed to extend swap file from 0 kb to xxx kb.
- Tomcat memory overflow in Eclipse: Java. Lang. outofmemoryerror: permgen space solution: