java虛擬機器記憶體檢視相關命令
jstack和執行緒dump分析:[url]http://jameswxx.iteye.com/blog/1041173[/url]
Java自帶的效能監測工具用法簡介:[url]http://blog.csdn.net/feihong247/article/details/7874063[/url]
linux下檢視虛擬機器的狀態:[url]http://blog.sina.com.cn/s/blog_472b9eb20100nhy5.html[/url]
JVM:檢視java記憶體情況命令:[url]http://www.cnblogs.com/zzck/archive/2016/07/26/5707168.html[/url]
檢視JAVA狀態的命令主要有一下幾種,jps,jinfo,jmap,jstack,jstat,jconsole,jVisualVM;
jconsole,jVisualVM是介面化的工具,這裡們就不講了,用用就知道,注意與JDK的版本問題;下面我們來看以下幾個命令jps(檢視java程序),jinfo(檢視JVM啟動引數),jmap(檢視堆記憶體狀態),jstack(檢視JVM執行緒執行狀態),jstat(檢視虛擬機器垃圾回收狀態)。
jps:檢視Java程序
[email protected]>jps
42548 JConsole
10868 Jps
29136 Bootstrap
2692 org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
37412
jinfo -flags:檢視java程序引數引數
[email protected]>jinfo -flags 2692
Attaching to process ID 2692, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 23.7-b01
-Dosgi.requiredJavaVersion=1.7 -Xms512m -Xmx1380m -Xss3m -XX:+UseParallelGC -Xverify:none
-XX:+DisableExplicitGC -Xnoclassgc -XX:CMSInitiatingOccupancyFraction=85 -XX:ReservedCod
eCacheSize=256m -XX:MaxPermSize=256m
jmap -heap:檢視堆狀況
[email protected]>jmap -heap 2692
Attaching to process ID 2692, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 23.7-b01
using thread-local object allocation.
Parallel GC with 4 thread(s)
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 1447034880 (1380.0MB) //最大堆空間
NewSize = 1310720 (1.25MB)
MaxNewSize = 17592186044415 MB
OldSize = 5439488 (5.1875MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 21757952 (20.75MB)
MaxPermSize = 268435456 (256.0MB)
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation //年輕代
Eden Space:
capacity = 387448832 (369.5MB)
used = 337520592 (321.8847198486328MB)
free = 49928240 (47.61528015136719MB)
87.11359129868276% used
From Space:
capacity = 47448064 (45.25MB)
used = 29189704 (27.83747100830078MB)
free = 18258360 (17.41252899169922MB)
61.51927294652106% used
To Space:
capacity = 47448064 (45.25MB)
used = 0 (0.0MB)
free = 47448064 (45.25MB)
0.0% used
PS Old Generation //老年代
capacity = 357957632 (341.375MB)
used = 217899800 (207.8054428100586MB)
free = 140057832 (133.5695571899414MB)
60.873070028578134% used
PS Perm Generation //永久代
capacity = 245891072 (234.5MB)
used = 122883168 (117.19052124023438MB)
free = 123007904 (117.30947875976562MB)
49.974635923340884% used
39279 interned Strings occupying 3731248 bytes.
jmap -dump:live,format=b,file=F:/heap.bin pid:dump java heap in hprof binary format
匯出堆二進位制資訊
[email protected]>jmap -dump:live,format=b,file=heap.bin 29136
Dumping heap to heap.bin ...
Heap dump file created
我們可以用MemoryAnalyzer分析檔案,介面如下:
[img]http://dl2.iteye.com/upload/attachment/0123/2948/8c7de339-4cd9-316b-9301-b0b38132c9b0.png[/img]
具體如何分析我們就不說,網上很多相關文章
[email protected]>jps
42548 JConsole
30708 Jps
29136 Bootstrap
2692 org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
37412
jmap -histo:live pid檢視堆中活動的物件以及大小
[email protected]>jmap -histo:live 29136 > jmap-histo.txt
jmap-histo.txt的先關資訊:
num #instances #bytes class name
----------------------------------------------
1: 104389 15407704 <constMethodKlass>
2: 105675 14934912 [C
3: 104389 13377904 <methodKlass>
4: 29296 11657864 [B
5: 8286 10644280 <constantPoolKlass>
6: 6968 6312896 <constantPoolCacheKlass>
7: 8286 6266968 <instanceKlassKlass>
8: 102853 2468472 java.lang.String
9: 3293 1912896 <methodDataKlass>
10: 9804 1328400 [I
11: 15433 1234640 java.lang.reflect.Method
12: 27893 892576 java.util.concurrent.ConcurrentHashMap$HashEntry
13: 9045 892056 java.lang.Class
14: 108 852304 [J
15: 12221 851448 [S
16: 18896 755840 java.util.LinkedHashMap$Entry
17: 13262 748464 [[I
18: 12725 624784 [Ljava.lang.Object;
19: 5072 580528 [Ljava.util.HashMap$Entry;
20: 17520 560640 java.util.HashMap$Entry
21: 7618 487552 java.net.URL
22: 742 403648 <objArrayKlassKlass>
23: 12033 385056 java.lang.ref.WeakReference
24: 14549 349176 java.util.ArrayList
25: 5488 307328 java.util.LinkedHashMap
26: 2225 298408 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
27: 5571 267408 org.apache.catalina.loader.ResourceEntry
28: 4921 236208 org.aspectj.weaver.reflect.ShadowMatchImpl
29: 6530 208600 [Ljava.lang.String;
30: 13015 208240 java.lang.Object
31: 4923 196920 java.lang.ref.SoftReference
32: 7706 164344 [Ljava.lang.Class;
33: 5002 160064 java.util.Hashtable$Entry
34: 4921 157472 org.aspectj.weaver.patterns.ExposedState
35: 3236 155328 java.util.HashMap
36: 5972 143328 java.beans.MethodRef
37: 2034 113904 java.beans.MethodDescriptor
38: 2334 112032 org.springframework.util.ConcurrentReferenceHashMap$SoftEntryReference
39: 1010 96960 org.springframework.beans.GenericTypeAwarePropertyDescriptor
40: 5285 94912 [Z
41: 3938 94512 java.util.Collections$UnmodifiableRandomAccessList
42: 1269 91368 java.lang.reflect.Constructor
43: 2225 89000 java.util.concurrent.ConcurrentHashMap$Segment
44: 981 86328 org.apache.ibatis.mapping.MappedStatement
45: 2570 82240 java.util.LinkedList
46: 2513 80416 java.util.concurrent.locks.ReentrantLock$NonfairSync
47: 4921 78736 [Lorg.aspectj.weaver.ast.Var;
48: 1025 73800 org.apache.jasper.compiler.Node$TemplateText
49: 957 68904 java.beans.PropertyDescriptor
50: 473 68112 org.aspectj.weaver.ReferenceType
51: 1179 66024 org.apache.jasper.compiler.Mark
52: 506 65504 [Ljava.util.Hashtable$Entry;
53: 111 63288 [Ljava.util.WeakHashMap$Entry;
54: 3734 59744 org.apache.ibatis.scripting.xmltags.TextSqlNode
55: 1816 58112 com.kingbase.util.Oid
56: 1441 57640 java.util.WeakHashMap$Entry
57: 784 56448 java.lang.reflect.Field
58: 940 52640 org.springframework.core.annotation.AnnotationAttributes
59: 804 51456 com.kingbase.core.Field
60: 1251 50040 org.apache.log4j.Logger
61: 2027 48648 java.util.LinkedList$Node
62: 304 48640 org.aspectj.weaver.BoundedReferenceType
63: 598 46832 [Ljava.util.concurrent.ConcurrentHashMap$Segment;
64: 1128 45120 java.util.TreeMap$Entry
65: 1841 44184 org.springframework.cglib.core.Signature
66: 898 43104 org.apache.tomcat.util.modeler.AttributeInfo
67: 1201 38432 java.util.Stack
68: 1559 37416 org.apache.log4j.CategoryKey
69: 2324 37184 java.util.LinkedHashSet
70: 2168 34688 java.util.HashMap$KeySet
71: 2069 33104 org.apache.ibatis.scripting.xmltags.MixedSqlNode
72: 687 32976 org.apache.tomcat.util.buf.ByteChunk
73: 575 32200 java.lang.Package
74: 639 30672 java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync
75: 221 30624 [[C
76: 195 29640 org.springframework.beans.factory.support.RootBeanDefinition
77: 598 28704 java.util.concurrent.ConcurrentHashMap
78: 137 28496 com.kingbase.jdbc4.Jdbc4Statement
79: 885 28320 org.springframework.cglib.proxy.MethodProxy
80: 1738 27808 java.util.Collections$UnmodifiableSet
81: 863 27616 org.springframework.cglib.proxy.MethodProxy$CreateInfo
82: 143 27456 com.kingbase.jdbc4.Jdbc4ResultSet
83: 13 26832 [Lorg.apache.ibatis.ognl.OgnlRuntime$ClassCache$Entry;
84: 552 26496 org.apache.tomcat.util.buf.MessageBytes
85: 222 26448 [Ljava.beans.MethodDescriptor;
86: 1074 25776 org.slf4j.impl.Log4jLoggerAdapter
87: 447 25032 org.apache.ibatis.mapping.ResultMap
88: 602 24080 org.apache.tomcat.util.buf.CharChunk
89: 981 23544 org.apache.ibatis.scripting.xmltags.DynamicSqlSource
90: 981 23544 org.apache.ibatis.mapping.ParameterMap
91: 1461 23376 java.util.HashSet
92: 724 23168 javax.management.MBeanAttributeInfo
93: 964 23136 org.apache.ibatis.scripting.xmltags.IfSqlNode
94: 453 21744 java.util.Hashtable
...
...n
416: 1 16 org.springframework.aop.support.annotation.AnnotationMethodMatcher
3417: 1 16 java.util.ResourceBundle$Control
3418: 1 16 sun.reflect.GeneratedMethodAccessor38
3419: 1 16 [Lcom.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler$OneSubGroup;
3420: 1 16 sun.nio.ch.Util$1
3421: 1 16 org.springframework.web.servlet.FrameworkServlet$ContextRefreshListener
3422: 1 16 org.apache.ibatis.ognl.ObjectPropertyAccessor
3423: 1 16 sun.reflect.GeneratedMethodAccessor8
3424: 1 16 com.sun.org.apache.xerces.internal.impl.dv.xs.IntegerDV
3425: 1 16 sun.reflect.GeneratedMethodAccessor30
3426: 1 16 org.springframework.beans.factory.parsing.FailFastProblemReporter
3427: 1 16 org.aspectj.util.FuzzyBoolean$NeverFuzzyBoolean
3428: 1 16 org.apache.catalina.connector.Request$5
3429: 1 16 org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration$1
3430: 1 16 com.fh.cachedb.CodeTableHolder
3431: 1 16 sun.reflect.GeneratedConstructorAccessor47
3432: 1 16 java.lang.String$CaseInsensitiveComparator
3433: 1 16 sun.reflect.GeneratedConstructorAccessor42
3434: 1 16 sun.reflect.GeneratedConstructorAccessor38
Total 946918 105239816
[email protected]>jps
42548 JConsole
30708 Jps
29136 Bootstrap
2692 org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
37412
jstack pid :檢視jvm執行緒執行狀態,是否有死鎖現象等等資訊)
[email protected]>jstack 29136 > jstack.txt
jstack.txt先關內容:
2017-02-23 18:44:50
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.79-b02 mixed mode):
"Attach Listener" daemon prio=10 tid=0x0000000000705800 nid=0x5e66 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
//執行緒池中的執行緒3正在執行
"pool-2-thread-3" prio=10 tid=0x0000000000867800 nid=0x5e04 runnable [0x00007fce9710f000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.createEntry(HashMap.java:897)
at java.util.HashMap.addEntry(HashMap.java:884)
at java.util.HashMap.put(HashMap.java:505)
at com.fh.util.PageData.put(PageData.java:73)
at com.fh.util.network.SqlTypeUtil.getCityData(SqlTypeUtil.java:37)
at com.fh.thread.CityDataToUpdateCallble.call(CityDataToUpdateCallble.java:109)
at com.fh.thread.CityDataToUpdateCallble.call(CityDataToUpdateCallble.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
//執行緒池中執行緒2,正在執行,在等待waiting on condition [0x00007fce97210000]
"pool-2-thread-2" prio=10 tid=0x0000000000855000 nid=0x5e01 waiting on condition [0x00007fce97210000]
java.lang.Thread.State: RUNNABLE
at com.fh.util.network.SqlTypeUtil.getCityData(SqlTypeUtil.java:35)
at com.fh.thread.CityDataToUpdateCallble.call(CityDataToUpdateCallble.java:109)
at com.fh.thread.CityDataToUpdateCallble.call(CityDataToUpdateCallble.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
//tomcat bio 執行緒處於等待狀態waiting on condition [0x00007fce960f1000]
"http-bio-8080-exec-10" daemon prio=10 tid=0x0000000000713000 nid=0x5dff waiting on condition [0x00007fce960f1000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000c71fe5e8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
...
"http-bio-8080-exec-1" daemon prio=10 tid=0x0000000000997800 nid=0x5df5 waiting on condition [0x00007fce9e05c000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000c71fe5e8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
//執行緒Java2D Disposer處於等待狀態:in Object.wait() [0x00007fce976b9000]
"Java2D Disposer" daemon prio=10 tid=0x0000000000e0f000 nid=0x5df8 in Object.wait() [0x00007fce976b9000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c758fa40> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
- locked <0x00000000c758fa40> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
at sun.java2d.Disposer.run(Disposer.java:145)
at java.lang.Thread.run(Thread.java:745)
"ajp-bio-8009-Acceptor-0" daemon prio=10 tid=0x00007fce904a8000 nid=0x5df3 runnable [0x00007fce9c162000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
at java.net.ServerSocket.implAccept(ServerSocket.java:530)
at java.net.ServerSocket.accept(ServerSocket.java:498)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:60)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:222)
at java.lang.Thread.run(Thread.java:745)
//處於睡眠狀態
"http-bio-8080-AsyncTimeout" daemon prio=10 tid=0x00007fce90793000 nid=0x5df2 sleeping[0x00007fce9dc58000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.apache.tomcat.util.net.JIoEndpoint$AsyncTimeout.run(JIoEndpoint.java:152)
at java.lang.Thread.run(Thread.java:745)
"http-bio-8080-Acceptor-0" daemon prio=10 tid=0x0000000000810000 nid=0x5df1 runnable [0x00007fce9dd59000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
at java.net.ServerSocket.implAccept(ServerSocket.java:530)
at java.net.ServerSocket.accept(ServerSocket.java:498)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:60)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:222)
at java.lang.Thread.run(Thread.java:745)
"ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon prio=10 tid=0x0000000001ec3800 nid=0x5df0 runnable [0x00007fce9de5a000]
java.lang.Thread.State: RUNNABLE
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
at java.io.File.isDirectory(File.java:843)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1151)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:497)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1757)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:333)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1370)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1542)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1552)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1520)
at java.lang.Thread.run(Thread.java:745)
//Druid執行緒池處理睡眠,等待waiting on condition [0x00007fce9c263000]
"Druid-ConnectionPool-Destroy-1086652952" daemon prio=10 tid=0x00007fce904ef800 nid=0x5def waiting on condition [0x00007fce9c263000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1898)
"Druid-ConnectionPool-Create-1086652952" daemon prio=10 tid=0x00007fce90015800 nid=0x5dee waiting on condition [0x00007fce9c364000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000c633d178> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1824)
"%0055ser%0058%004dapper.data" prio=10 tid=0x00007fce904cf800 nid=0x5dec waiting on condition [0x00007fce9c882000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000c6196fe8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1090)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:807)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
"[email protected]" daemon prio=10 tid=0x00007fce904bf800 nid=0x5dea in Object.wait() [0x00007fce9c983000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c61bed80> (a java.util.TaskQueue)
at java.lang.Object.wait(Object.java:503)
at java.util.TimerThread.mainLoop(Timer.java:526)
- locked <0x00000000c61bed80> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:505)
"Druid-ConnectionPool-Destroy-1795695054" daemon prio=10 tid=0x00007fce904b7000 nid=0x5de9 waiting on condition [0x00007fce9ccc2000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:1898)
"Druid-ConnectionPool-Create-1795695054" daemon prio=10 tid=0x00007fce90537800 nid=0x5de8 waiting on condition [0x00007fce9cdc3000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000c627f1d0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1824)
"Abandoned connection cleanup thread" daemon prio=10 tid=0x00007fce90419000 nid=0x5de6 in Object.wait() [0x00007fce9cec4000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627f208> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
- locked <0x00000000c627f208> (a java.lang.ref.ReferenceQueue$Lock)
at com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
"Timer-0" daemon prio=10 tid=0x00007fce90351800 nid=0x5de5 in Object.wait() [0x00007fce9cfc5000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627f2a8> (a java.util.TaskQueue)
at java.util.TimerThread.mainLoop(Timer.java:552)
- locked <0x00000000c627f2a8> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:505)
//定時任務排程執行緒,初始化10個執行緒,
"schedulerFactoryBean_QuartzSchedulerThread" prio=10 tid=0x00007fce9034c000 nid=0x5de4 runnable [0x00007fce9d0c6000]
java.lang.Thread.State: RUNNABLE
at org.quartz.utils.Key.compareTo(Key.java:152)
at org.quartz.Trigger$TriggerTimeComparator.compare(Trigger.java:321)
at org.quartz.Trigger$TriggerTimeComparator.compare(Trigger.java:326)
at org.quartz.simpl.TriggerWrapperComparator.compare(RAMJobStore.java:1705)
at org.quartz.simpl.TriggerWrapperComparator.compare(RAMJobStore.java:1698)
at java.util.TreeMap.getEntryUsingComparator(TreeMap.java:369)
at java.util.TreeMap.getEntry(TreeMap.java:340)
at java.util.TreeMap.remove(TreeMap.java:595)
at java.util.TreeSet.remove(TreeSet.java:276)
at org.quartz.simpl.RAMJobStore.acquireNextTriggers(RAMJobStore.java:1403)
- locked <0x00000000c62cd9e8> (a java.lang.Object)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:272)
//RUNNABLE
"schedulerFactoryBean_Worker-10" prio=10 tid=0x00007fce90348000 nid=0x5de3 runnable [0x00007fce9d1c7000]
java.lang.Thread.State: RUNNABLE
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627f420> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c627f420> (a java.lang.Object)
//TIMED_WAITING
"schedulerFactoryBean_Worker-9" prio=10 tid=0x00007fce90346800 nid=0x5de2 in Object.wait() [0x00007fce9d2c8000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627f4b0> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c627f4b0> (a java.lang.Object)
//RUNNABLE
"schedulerFactoryBean_Worker-8" prio=10 tid=0x00007fce90335800 nid=0x5de1 runnable [0x00007fce9d3c9000]
java.lang.Thread.State: RUNNABLE
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627f540> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c627f540> (a java.lang.Object)
//TIMED_WAITING
"schedulerFactoryBean_Worker-7" prio=10 tid=0x00007fce90333800 nid=0x5de0 in Object.wait() [0x00007fce9d4ca000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627f5d0> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c627f5d0> (a java.lang.Object)
//TIMED_WAITING
"schedulerFactoryBean_Worker-6" prio=10 tid=0x00007fce90331800 nid=0x5ddf in Object.wait() [0x00007fce9d5cb000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627f660> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c627f660> (a java.lang.Object)
//TIMED_WAITING
"schedulerFactoryBean_Worker-5" prio=10 tid=0x00007fce90330000 nid=0x5dde in Object.wait() [0x00007fce9d6cc000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c62804c0> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c62804c0> (a java.lang.Object)
//TIMED_WAITING
"schedulerFactoryBean_Worker-4" prio=10 tid=0x00007fce9032e000 nid=0x5ddd in Object.wait() [0x00007fce9d7cd000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c62802f0> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c62802f0> (a java.lang.Object)
//TIMED_WAITING
"schedulerFactoryBean_Worker-3" prio=10 tid=0x00007fce9032c800 nid=0x5ddc in Object.wait() [0x00007fce9d8ce000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c6280120> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c6280120> (a java.lang.Object)
//TIMED_WAITING
"schedulerFactoryBean_Worker-2" prio=10 tid=0x00007fce9032b000 nid=0x5ddb in Object.wait() [0x00007fce9d9cf000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627ff50> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c627ff50> (a java.lang.Object)
//RUNNABLE
"schedulerFactoryBean_Worker-1" prio=10 tid=0x00007fce90327000 nid=0x5dda runnable [0x00007fce9dad0000]
java.lang.Thread.State: RUNNABLE
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c627fd80> (a java.lang.Object)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
- locked <0x00000000c627fd80> (a java.lang.Object)
//GC
"GC Daemon" daemon prio=10 tid=0x00000000008a1000 nid=0x5dd7 in Object.wait() [0x00007fce9e5f6000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c5628bf0> (a sun.misc.GC$LatencyLock)
at sun.misc.GC$Daemon.run(GC.java:117)
- locked <0x00000000c5628bf0> (a sun.misc.GC$LatencyLock)
"Service Thread" daemon prio=10 tid=0x00007fce98035800 nid=0x5dd5 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
//編譯執行緒
"C2 CompilerThread1" daemon prio=10 tid=0x00007fce98033000 nid=0x5dd4 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" daemon prio=10 tid=0x00007fce98030000 nid=0x5dd3 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=10 tid=0x00007fce9802d800 nid=0x5dd2 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=10 tid=0x00007fce98001000 nid=0x5dd1 in Object.wait() [0x00007fce9f41e000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c5842558> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
- locked <0x00000000c5842558> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)
"Reference Handler" daemon prio=10 tid=0x0000000000677800 nid=0x5dd0 in Object.wait() [0x00007fce9f51f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000c56a9438> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:503)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
- locked <0x00000000c56a9438> (a java.lang.ref.Reference$Lock)
//主執行緒
"main" prio=10 tid=0x000000000060a800 nid=0x5dc6 runnable [0x00007fcea9817000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
at java.net.ServerSocket.implAccept(ServerSocket.java:530)
at java.net.ServerSocket.accept(ServerSocket.java:498)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:470)
at org.apache.catalina.startup.Catalina.await(Catalina.java:781)
at org.apache.catalina.startup.Catalina.start(Catalina.java:727)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)
//虛擬機器執行緒
"VM Thread" prio=10 tid=0x0000000000673000 nid=0x5dcf runnable
//GC任務執行緒
"GC task thread#0 (ParallelGC)" prio=10 tid=0x0000000000620800 nid=0x5dc7 runnable
"GC task thread#1 (ParallelGC)" prio=10 tid=0x0000000000622800 nid=0x5dc8 runnable
"GC task thread#2 (ParallelGC)" prio=10 tid=0x0000000000624000 nid=0x5dc9 runnable
"GC task thread#3 (ParallelGC)" prio=10 tid=0x0000000000626000 nid=0x5dca runnable
"GC task thread#4 (ParallelGC)" prio=10 tid=0x0000000000628000 nid=0x5dcb runnable
"GC task thread#5 (ParallelGC)" prio=10 tid=0x0000000000629800 nid=0x5dcc runnable
"GC task thread#6 (ParallelGC)" prio=10 tid=0x000000000062b800 nid=0x5dcd runnable
"GC task thread#7 (ParallelGC)" prio=10 tid=0x000000000062d800 nid=0x5dce runnable
"VM Periodic Task Thread" prio=10 tid=0x00007fce98040800 nid=0x5dd6 waiting on condition
JNI global references: 478
jstat -gc pid:可以顯示gc的資訊,檢視gc的次數,及時間。
[email protected]>jstat -gc 29136
S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT
4288.0 4288.0 1639.1 0.0 34688.0 33781.3 86336.0 45491.6 83968.0 59198.3 96 0.521 6 0.714 1.235
其中最後五項,分別是young gc的次數,young gc的時間,full gc的次數,full gc的時間,gc的總時間。
jstat -util pid:統計gc資訊統計與-gc合用。
jstat -gcutil PID 1000(重新整理頻率) 3(次數):檢視jvm的gc情況和記憶體使用情況
[email protected]> jstat -gcutil 29136 1000 3
S0 S1 E O P YGC YGCT FGC FGCT GCT
0.00 35.42 55.86 50.93 70.10 87 0.491 6 0.714 1.205
0.00 35.42 57.56 50.93 70.10 87 0.491 6 0.714 1.205
0.00 35.42 58.04 50.93 70.10 87 0.491 6 0.714 1.205
S0:Heap上的 Survivor space 0 段已使用空間的百分比
S1:Heap上的 Survivor space 1 段已使用空間的百分比
E: Heap上的 Eden space 段已使用空間的百分比
O:Heap上的 Old space 段已使用空間的百分比
P: Perm space 已使用空間的百分比
YGC:從程式啟動到取樣時發生Young GC的次數
YGCT:Young GC所用的時間(單位秒)
FGC:從程式啟動到取樣時發生Full GC的次數
FGCT:Full GC所用的時間(單位秒)
GCT:用於垃圾回收的總時間(單位秒)
jstat -class pid:顯示載入class的數量,及所佔空間等資訊
[email protected]>jstat -class 29136
Loaded Bytes Unloaded Bytes Time
8735 18805.4 85 137.6 7.86
jstat -compiler pid:顯示VM實時編譯的數量等資訊。
[email protected]>jstat -compiler 29136
Compiled Failed Invalid Time FailedType FailedMethod
2093 1 0 24.51 1 org/apache/catalina/loader/WebappClassLoaderBase findResourceInternal
jstat -gccapacity pid:可以顯示,VM記憶體中三代(young,old,perm)物件的使用和佔用大小,
[email protected]>jstat -gccapacity 29136
NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC PGCMN PGCMX PGC PC YGC FGC
43136.0 340736.0 43264.0 4288.0 4288.0 34688.0 86336.0 1731840.0 86336.0 86336.0 21248.0 83968.0 83968.0 83968.0 98 6
如:PGCMN顯示的是最小perm的記憶體使用量,PGCMX顯示的是perm的記憶體最大使用量,
PGC是當前新生成的perm記憶體佔用量,PC是但前perm記憶體佔用量。其他的可以根據這個類推, OC是old內純的佔用量。
jstat -gcnew pid:new物件的資訊。
[email protected]>jstat -gcnew 29136
S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
4288.0 4288.0 0.0 3512.2 6 6 2144.0 34688.0 28683.1 101 0.553
jstat -gcnewcapacity pid:new物件的資訊及其佔用量。
[email protected]>jstat -gcnewcapacity 29136
NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC
43136.0 340736.0 43264.0 34048.0 4288.0 34048.0 4288.0 272640.0 34688.0 102 6
jstat -gcold pid:old物件的資訊。
[email protected]>jstat -gcold 29136
PC PU OC OU YGC FGC FGCT GCT
83968.0 59291.3 86336.0 50136.9 102 6 0.714 1.270
jstat -gcoldcapacity pid:old物件的資訊及其佔用量。
[email protected]>jstat -gcoldcapacity 29136
OGCMN OGCMX OGC OC YGC FGC FGCT GCT
86336.0 1731840.0 86336.0 86336.0 102 6 0.714 1.270
jstat -gcpermcapacity pid: perm物件的資訊及其佔用量。
[email protected]>jstat -gcpermcapacity 29136
PGCMN PGCMX PGC PC YGC FGC FGCT GCT
21248.0 83968.0 83968.0 83968.0 103 6 0.714 1.272
jstat -printcompilation pid:當前VM執行的資訊
[email protected]>jstat -printcompilation 29136
Compiled Size Type Method
2162 141 1 com/kingbase/core/KB_Stream_Tcpip Receive
檢視虛擬機器狀態用到的幾個重要命令
jps
jinfo -flags 2692
jmap -heap 2692
jmap -dump:live,format=b,file=heap.bin 29136
jmap -histo:live 29136 > jmap-histo.txt
jstack 29136 > jstack.txt
jstat -gcutil 29136 1000 3
問題:
[color=red]1.Attaching to process ID 60064, please wait...
Error attaching to process: Windbg Error: ReadVirtual failed!
2.60064: Unable to attach to 32-bit process running under WOW64
The -F option can be used when the target process is not responding[/color]
當出現以上問題時:首先看JDK版本、位數,再看執行緒許可權。
相關推薦
java虛擬機器記憶體檢視相關命令
關於cmd命令的重定向輸出 :[url]http://blog.csdn.net/jw72jw/article/details/7404255[/url]jstack和執行緒dump分析:[url]http://jameswxx.iteye.com/blog/1041173[
《深入理解Java虛擬機器》個人讀書總結——JAVA虛擬機器記憶體
《深入理解Java虛擬機器》個人讀書總結——JAVA虛擬機器記憶體 最近在讀《深入理解Java虛擬機器》,網上對Java虛擬機器的總結有很多,自己覺得自己也應該記錄一點個人的讀書總結,以便日後複習方便。 隨著開發工作的逐漸深入,對Java的理解不能止步於crud,Java不像C語言
java虛擬機器(第二版) 第二章總結 (三)-手工復現java虛擬機器記憶體溢位(OutOfMemoryError異常)
文章概述 的java虛擬機器記憶體溢位的簡要概述,復現堆記憶體,棧記憶體,方法區的執行時常量池記憶體等區域的溢位情況,以及上述區域發生記憶體溢位的判斷方式和解決思路。 1,概述: IDE為eclipse,需要在執
jvm學習筆記(1)——java虛擬機器記憶體區域
一、java記憶體區域: 1、程式計數器(執行緒私有): 記憶體中較小的記憶體空間,可以當做當前執行緒所執行位元組碼的行號指示器。如分支、迴圈、跳轉、異常處理、執行緒恢復都需要依賴這個計數器完成。 2、java虛擬機
Java虛擬機器 記憶體管理與垃圾回收
java和C++之間有一堵由記憶體自動分配與垃圾回收所圍成的高牆,外面的人想進來,裡面的人想出去 主要內容 記憶體分佈 垃圾回收機制 垃圾收集器 Java記憶體分佈 當java虛擬機器執行程式時,會把由虛擬機器管理的記憶體劃分為不同的區域,他們的作用不同,建立和銷燬時間也不同,有的是虛擬
Java虛擬機器—記憶體模型與執行緒
Java虛擬機器—記憶體模型與執行緒 Lyon Keep balance,Be a better man! 關注他 3 人讚了該文章 前言: 本文主要介紹Java的記憶體模型和Java執行緒。 Java記憶體模型的主要目標是定義程式中各個變數的訪問規則,即在JVM
JVM系列第6講:Java 虛擬機器記憶體結構
看到這裡,我相信大家對於一個 Java 原始檔是如何變成位元組碼檔案,以及位元組碼檔案的含義已經非常清楚了。那麼接下來就是讓 Java 虛擬機器執行位元組碼檔案,從而得出我們最終想要的結果了。在這個過程中,Java 虛擬機器會載入位元組碼檔案,將其存入 Java 虛擬機器的記憶體空間中,之後進行一系列的初始化
JVM調優--------理解java虛擬機器記憶體模型
java虛擬機器記憶體模型是java程式執行的基礎,為了能使Java應用程式正常執行,JVM虛擬機器將記憶體資料分為程式計數器,虛擬機器棧,本地方法棧,Java堆和方法區 程式計數器用於存放下一條執行的指令;虛擬機器棧和本地方法棧用於存放函式呼叫堆疊資訊;java堆用於存放Java程式執行時所需
Confluence 提高Java虛擬機器記憶體
Confluence 提高Java虛擬機器記憶體 版本 系統:CentOS release 6.8 (Final)Java版本:1.8.0_162Confluence版本:6.8.5 問題描述 confluence記憶體使用率的配置都是預設的,相對會比較低,可以根據實際server的配置情況,升級記憶
JVM篇:淺談java虛擬機器記憶體模型
博主最近嘗試著瞭解JVM,博主目前的一些理解,總之會隨著博主的深入瞭解慢慢完善吧 圖片來自網路 當JVM執行時,便會建立這五個區域,退出時銷燬。 JVM的五個區域:方法區、堆、棧(也可以稱為虛擬機器棧)、程式計數器、本地方法棧 博主在這裡說明一下:方法區概括了元空間
Java虛擬機器-記憶體管理
參考深入理解Java虛擬機器 執行時記憶體包括: 方法區(Method Area) 虛擬機器棧(VM Stack) 本地方法棧(Native Method Stack) 堆(Heap) 程式計數器(Program counter Register) 程式計數器
JAVA虛擬機器記憶體劃分學習
JAVA虛擬機器所管理的記憶體將分為以下幾個區: 1.程式計數器:主要包括程式的分支、迴圈、跳轉、異常處理等基礎功能; 2.棧:主要用於儲存區域性變數、方法出口、物件引用等資訊; 是執行緒私有的,生命週期與執行緒相同; 3.堆:主要儲存物件的例項;是執
java 虛擬機器記憶體劃分,類載入過程以及物件的初始化
涉及關鍵詞: 虛擬機器執行時記憶體 java記憶體劃分 類載入順序 類載入時機 類載入步驟 物件初始化順序 構造程式碼塊順序 構造方法 順序 記憶體區域 java記憶體圖 堆 方法區 虛擬機器棧 本地方法棧 程式計數器 區域性變量表 棧幀 java堆 執行時常量池 直接記憶體
Java 虛擬機器記憶體溢位問題和解決方法
一什麼是記憶體溢位 1記憶體溢位是指應用系統中存在無法回收的記憶體或使用的記憶體過多,最終使得程式執行要用到的記憶體大於虛擬機器能提供的最大記憶體。 2 Java的記憶體管理就是物件的分配和釋放問題。 在Java中,記憶體的分配是由程式完成的,而記憶體的釋
Java虛擬機器記憶體結構介紹
文章目錄 一 前言 二 JVM記憶體結構 三 程式計數器 四 虛擬機器棧 五 本地方法棧 六 GC堆 七 方法區 八 執行時常量池 九 直接記憶體 十 總結 一
【Java JVM】Java虛擬機器記憶體分配幾個原則
1、大多數情況下,物件在新生代Eden區中分配。當Eden區沒有足夠空間進行分配時,虛擬機器將發起一次Minor GC 2、大物件直接進入老年代。大物件指需要大量連續記憶體空間的Java物件,最典型的
java虛擬機器記憶體區域的劃分以及作用詳解
為什麼有時候學著學著會突然之間覺得一切度是那麼無趣,男的每個月也有那麼幾天難道?哈哈,不然是什麼,我還是要堅持,可以做少一點,但是不能什麼度不做。總會過去的,加油
Java虛擬機器記憶體管理知識總結
0、Java 對記憶體的劃分: Java虛擬機器規範將實體記憶體(主記憶體和CPU中的快取、暫存器)劃分為 程式計數器 、 Java 虛擬機器棧 、 本地方法棧 、 Java 堆 、 方法區 
java虛擬機器-記憶體分配與回收策略
1.物件優先在Eden分配 大多數情況下,物件在新生代Eden區分配。當Eden區沒有足夠空間進行分配時,虛擬機器將發起一次Minor GC。 虛擬機器提供了-XX:+PrintGCDetails這個收集器日誌引數,告訴虛擬機器在傳送垃圾收集行為時列印記憶體回收日誌,並且在
Java虛擬機器記憶體——棧、堆、Non-heap
Java中通過多執行緒使得多個任務同時執行處理,所有的執行緒共享JVM記憶體區域main memory,而每個執行緒又有自己的工作記憶體,當執行緒與記憶體區域進行互動時,資料從主存拷貝到工作記憶體,進而交由執行緒處理。 Java虛擬機器記憶體模型中定義的訪問操作與物理計算