Swap Space increase to 1 GB in Solaris 8.0 with JDK 1.3.1 and hangs

Hi,

We are having a GUI intensive JAVA application built with AWT components,

The approximate size of the JAVA code is about 80 KLOC and about 75 GUI screens.

We are testing the application in Solaris 8.0 , Java JDK 1.3.1 , with Hotspot Client option, with the default heap size of 64 MB and 1 GB of Swap space.

In the GUI testing , When we are testing the application by opening and closing the dialogs, we found that gSwap space is increasing enormously h for each and every step of opening and closing of dialogs.

It is observed that when a dialog is opened ( with around 30 strings to be displayed ) , there is an appreciable increase in the data segment and correspondingly the swap space utilization is increased.

When the above process is repeated around 26 iterations ( Each iteration consists of opening and closing of dialogs 50 times , TOTAL = 26 * 50 Open/Close dialogs ) the swap space reaches a maximum of 1 GB and the application gets hanged.

In addition to the AWT components we are also using JNI components, and we ensured that JNI code is NOT giving any problem at all.

In spite of the huge memory consumption, Interestingly the JVM heap space was very much normal and it is NOT giving any problem.

We are working on two theories

1)Application is having Memory Leaks

We are analyzing the application with various tools and here with we are attaching a memory usage data collected using gGLANCE PLUS h

2)Application is NOT having memory leaks

From the documents downloaded from SUN sites , it is observed that tuning of KERNEL parameters will help in tuning the applications , and also we understand that SWAP SPACE utilization could be controlled by tuning KERNEL parameters but we are not sure of the parameters to be tuned (Your Suggestion and Help is required at this point)

We are expecting a favorable reply to the following questions .

Question 1 : When JVM Heap is not giving any error like gOut of Heap h , How swap space could increase ?

Question 2 : What is the way to stop Swap Space growing , when only JAVA application is executed ( JNI components NOT used ) ?

Question 3 : How JVM uses the swap Space , Is there any leak in JVM in using Swap space ?

-GLANCE PLUS RESULTS-

* - Plz note the HIGHLIGHTED items.

B3694A GlancePlus C.03.10.0015:34:52 ultra10sun4uCurrent Avg High

--

CPU UtilS| 1%18%32%

Disk Util| 0%1%6%

Mem UtilS SUU| 61%54%61%

Swap UtilUUR | 17%14%17%

Memory Regions PID: 2697, javaPPID:2696 User: root

TypeRefCntVSS VirtAddress File Name

--

TEXT /P424kb 0x00010000 <reg,ufs,i...x01a209f8>

BSS/P48kb 0x00024000 <reg,ufs,i...x01a209f8>

DATA /P1 68.0mb 0x00026000 <data>

DATA /P1520kb 0xf3e80000 <data>

DATA /P1520kb 0xf3f80000 <data>

DATA /P1520kb 0xf4080000 <data>

DATA /P1520kb 0xf4180000 <data>

DATA /P1520kb 0xf4280000 <data>

DATA /P1520kb 0xf4380000 <data>

SHMEM /S5208kb 0xf4440000 <shmem>

Text VSS: 7.4mbData VSS: 212mbStack VSS: 512kb

Shmem VSS: 216kbOther VSS: 21mbTotal VSS: 112mb

Swap Device TypeAvail (mb)Used (mb)

--

/dev/dsk/c0t1d0s1 device1000mb52mb

pseudo-swapmemory368mb160mb

Swap Avail: 1369mb Swap Used: 213mb Resvd Util (%): 17 Swap Reserved: 234mb

********* AFTER OPENING AND CLOSING THE DIALOG 10 TIMES *************

B3694A GlancePlus C.03.10.0015:36:25 ultra10sun4uCurrent Avg High

CPU UtilSU| 3%21%76%

Disk Util| 0%0%6%

Mem UtilS SU U | 66%58%66%

Swap UtilU UR | 19%15%19%

Memory Regions PID: 2697, javaPPID:2696 User: root

TypeRefCntVSS VirtAddress File Name

--

TEXT /P424kb 0x00010000 <reg,ufs,i...x01a209f8>

BSS/P48kb 0x00024000 <reg,ufs,i...x01a209f8>

DATA /P1 92.3mb 0x00026000 <data>

DATA /P1520kb 0xf3e80000 <data>

DATA /P1520kb 0xf3f80000 <data>

DATA /P1520kb 0xf4080000 <data>

DATA /P1520kb 0xf4180000 <data>

DATA /P1520kb 0xf4280000 <data>

DATA /P1520kb 0xf4380000 <data>

SHMEM /S5208kb 0xf4440000 <shmem>

Text VSS: 7.4mbData VSS: 236mbStack VSS: 512kb

Shmem VSS: 216kbOther VSS: 21mbTotal VSS: 136mb

Swap Device TypeAvail (mb)Used (mb)

--

/dev/dsk/c0t1d0s1 device1000mb52mb

pseudo-swapmemory368mb189mb

Swap Avail: 1369mb Swap Used: 241mb Resvd Util (%): 19 Swap Reserved: 262mb

********* AFTER OPENING AND CLOSING THE DIALOG 20 TIMES ( an increment of 10 from the previous step)*************

B3694A GlancePlus C.03.10.0015:38:31 ultra10sun4uCurrent Avg High

CPU UtilSU| 3%21%76%

Disk Util| 0%0%6%

Mem UtilS SU U| 71%62%71%

Swap UtilU UR | 21%17%21%

Memory Regions PID: 2697, javaPPID:2696 User: root

TypeRefCntVSS VirtAddress File Name

--

TEXT /P424kb 0x00010000 <reg,ufs,i...x01a209f8>

BSS/P48kb 0x00024000 <reg,ufs,i...x01a209f8>

DATA /P1 114.3mb 0x00026000 <data>

DATA /P1520kb 0xf3e80000 <data>

DATA /P1520kb 0xf3f80000 <data>

DATA /P1520kb 0xf4080000 <data>

DATA /P1520kb 0xf4180000 <data>

DATA /P1520kb 0xf4280000 <data>

DATA /P1520kb 0xf4380000 <data>

SHMEM /S5208kb 0xf4440000 <shmem>

Text VSS: 7.4mbData VSS: 258mbStack VSS: 512kb

Shmem VSS: 216kbOther VSS: 21mbTotal VSS: 158mb

Swap Device TypeAvail (mb)Used (mb)

--

/dev/dsk/c0t1d0s1 device1000mb52mb

pseudo-swapmemory368mb215mb

Swap Avail: 1369mb Swap Used: 267mb Resvd Util (%): 21 Swap Reserved: 288mb

********* AFTER OPENING AND CLOSING THE DIALOG 30 TIMES ( an increment of 10 from the previous step)*************

B3694A GlancePlus C.03.10.0015:39:47 ultra10sun4u Current Avg High

--

CPU UtilSU | 4%23%83%

Disk Util| 0%0%6%

Mem UtilS SUU| 77%64%77%

Swap UtilUUR | 23%18%23%

Memory Regions PID: 2697, javaPPID:2696 User: root

TypeRefCntVSS VirtAddress File Name

--

TEXT /P424kb 0x00010000 <reg,ufs,i...x01a209f8>

BSS/P48kb 0x00024000 <reg,ufs,i...x01a209f8>

DATA /P1 139.8mb 0x00026000 <data>

DATA /P1520kb 0xf3e80000 <data>

DATA /P1520kb 0xf3f80000 <data>

DATA /P1520kb 0xf4080000 <data>

DATA /P1520kb 0xf4180000 <data>

DATA /P1520kb 0xf4280000 <data>

DATA /P1520kb 0xf4380000 <data>

SHMEM /S5248kb 0xf4430000 <shmem>

Text VSS: 7.4mbData VSS: 284mbStack VSS: 512kb

Shmem VSS: 256kbOther VSS: 21mbTotal VSS: 184mb

Swap Device TypeAvail (mb)Used (mb)

--

/dev/dsk/c0t1d0s1 device1000mb52mb

pseudo-swapmemory368mb244mb

Swap Avail: 1369mb Swap Used: 296mb Resvd Util (%): 23 Swap Reserved: 318mb

********* AFTER OPENING AND CLOSING THE DIALOG 40 TIMES ( an increment of 10 from the previous step)*************

B3694A GlancePlus C.03.10.0015:41:09 ultra10sun4uCurrent Avg High

CPU UtilS | 1%24%83%

Disk Util| 0%0%8%

Mem UtilS SU U | 84%67%84%

Swap UtilUUR| 26%19%26%

Memory Regions PID: 2697, javaPPID:2696 User: root

TypeRefCntVSS VirtAddress File Name

--

TEXT /P424kb 0x00010000 <reg,ufs,i...x01a209f8>

BSS/P48kb 0x00024000 <reg,ufs,i...x01a209f8>

DATA /P1 171.9mb 0x00026000 <data>

DATA /P1520kb 0xf3e80000 <data>

DATA /P1520kb 0xf3f80000 <data>

DATA /P1520kb 0xf4080000 <data>

DATA /P1520kb 0xf4180000 <data>

DATA /P1520kb 0xf4280000 <data>

DATA /P1520kb 0xf4380000 <data>

SHMEM /S5208kb 0xf4440000 <shmem>

Text VSS: 7.4mbData VSS: 316mbStack VSS: 512kb

Shmem VSS: 216kbOther VSS: 21mbTotal VSS: 216mb

Swap Device TypeAvail (mb)Used (mb)

--

/dev/dsk/c0t1d0s1 device1000mb52mb

pseudo-swapmemory368mb279mb

Swap Avail: 1369mb Swap Used: 332mb Resvd Util (%): 26 Swap Reserved: 354mb

********* AFTER OPENING AND CLOSING THE DIALOG 50 TIMES ( an increment of 10 from the previous step)*************

[8494 byte] By [aisacnewton] at [2007-9-26 6:43:49]
# 1

The is no such thing as 'swap' space in the java domain.

The only real control you have over memory in java is the heap and stack. Changing these affects the total memory that a java process uses, but it does not specify how much space it will use.

Swap space is how the OS controls virtual memory for all processes. If you are running with a 64 heap space then I would suspect the following:

-There is one or more other processes on the box and they are causing the problems.

-The JNI code is using large amounts of memory.

jschell at 2007-7-1 16:05:20 > top of Java-index,Java HotSpot Virtual Machine,Specifications...