If Java runs out of memory, the following error occurs:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
This can have two reasons:
- Your Java application has a memory leak. There are tools like YourKit Java Profiler that help you to identify such leaks.
- Your Java application really needs a lot of memory (more than 128 MB by default!). In this case the Java heap size can be increased using the following runtime parameters:
java -Xms<initial heap size> -Xmx<maximum heap size>
Defaults are:
java -Xms32m -Xmx128m
You can set this either in the Java Control Panel or on the command line, depending on the environment you run your application.
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
25 | 26 | 27 | 28 | 29 | 30 | 31 | |||
1 | 2 | 3 | 4 | 5 | 6 | 7 | |||
8 | 9 | 10 | 11 | 12 | 13 | 14 | |||
15 | 16 | 17 | 18 | 19 | 20 | 21 | |||
22 | 23 | 24 | 25 | 26 | 27 | 28 | |||
29 | 30 | 1 | 2 | 3 | 4 | 5 |
常用鏈接
留言簿
隨筆分類
隨筆檔案
文章檔案
搜索
最新評論

- 1.?re: windows 淡綠色
- 應該是不符合中國人的生理特征。
- --隔葉黃鶯-2
- 2.?re: Java虛擬機(JVM)中的內存設置詳解
- 很有用,收藏了,謝謝!
- --隔葉黃鶯