테스트 환경

  • OS : CentOS
  • JDK : 1.7 Update 67
  • Tomcat : 7.0.55
  • JBoss : 6.1 EAP

양 쪽 모두 메모리 옵션은 "-Xms1024m -Xmx1024m -MaxPermSize:256m"이며, JBoss 는 standalone.xml을 사용하였고, 동일하게 배포된 소스는 테스트 용 index.jsp 하나였습니다.

그리고 jmap -heap 결과로 비교합니다.

 

1. Tomcat

Debugger attached successfully.
Server compiler detected.
JVM version is 24.65-b04

using thread-local object allocation.
Parallel GC with 1 thread(s)

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 1073741824 (1024.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 = 268959744 (256.5MB)
   used     = 209978176 (200.25079345703125MB)
   free     = 58981568 (56.24920654296875MB)
   78.07048477856969% used
From Space:
   capacity = 44564480 (42.5MB)
   used     = 0 (0.0MB)
   free     = 44564480 (42.5MB)
   0.0% used
To Space:
   capacity = 44564480 (42.5MB)
   used     = 0 (0.0MB)
   free     = 44564480 (42.5MB)
   0.0% used
PS Old Generation
   capacity = 716177408 (683.0MB)
   used     = 0 (0.0MB)
   free     = 716177408 (683.0MB)
   0.0% used
PS Perm Generation
   capacity = 22020096 (21.0MB)
   used     = 15672144 (14.946121215820312MB)
   free     = 6347952 (6.0538787841796875MB)
   71.17200578962054% used

8838 interned Strings occupying 734576 bytes.

 

2. JBoss

Debugger attached successfully.
Server compiler detected.
JVM version is 24.65-b04

using thread-local object allocation.
Parallel GC with 1 thread(s)

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize      = 1073741824 (1024.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 = 268959744 (256.5MB)
   used     = 242754536 (231.5087661743164MB)
   free     = 26205208 (24.991233825683594MB)
   90.25682891786215% used
From Space:
   capacity = 44564480 (42.5MB)
   used     = 22920656 (21.858840942382812MB)
   free     = 21643824 (20.641159057617188MB)
   51.432566923253674% used
To Space:
   capacity = 44564480 (42.5MB)
   used     = 0 (0.0MB)
   free     = 44564480 (42.5MB)
   0.0% used
PS Old Generation
   capacity = 716177408 (683.0MB)
   used     = 0 (0.0MB)
   free     = 716177408 (683.0MB)
   0.0% used
PS Perm Generation
   capacity = 40370176 (38.5MB)
   used     = 40199968 (38.337677001953125MB)
   free     = 170208 (0.162322998046875MB)
   99.57838182325487% used

14783 interned Strings occupying 1406320 bytes.