close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_delta.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Feb 27, 2011, 11:14:46 PM (15 years ago)
- Author:
-
jazz
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v1
|
v2
|
|
| 67 | 67 | vm.swappiness = 0 |
| 68 | 68 | }}} |
| | 69 | * [http://www.javaworld.com.tw/jute/post/view?bid=29&id=9589&tpg=1&ppg=1&sty=3&age=-1 20.如何取得記憶體的統計資料(memory statistics)?] 介紹如何寫 Java 記憶體 |
| | 70 | {{{ |
| | 71 | public class MemoryStats{ |
| | 72 | public static void main(String args[]){ |
| | 73 | long totalMem = Runtime.getRuntime().totalMemory(); |
| | 74 | long freeMem = Runtime.getRuntime().freeMemory(); |
| | 75 | System.out.println("Total memory"+ totalMem); |
| | 76 | System.out.println("Free memory" + freeMem); |
| | 77 | } |
| | 78 | } |
| | 79 | }}} |