harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Shipilev (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4489) [drlvm][threading] Threads consume too much memory
Date Wed, 18 Jul 2007 09:58:04 GMT
[drlvm][threading] Threads consume too much memory
--------------------------------------------------

                 Key: HARMONY-4489
                 URL: https://issues.apache.org/jira/browse/HARMONY-4489
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Linux 32/64
            Reporter: Aleksey Shipilev
            Priority: Critical


Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64.

A simple test (ThreadTest.java) creates N empty threads before memory running out, so it is
possible to  measure how much each thread takes.
During run two points were taken: "reference", some time after the test starts and "final",
when test stops. 
Per-thread memory size was calculated as:

Per-thread = [ VmSize(final) - VmSize(reference) ] / [ ThreadCount(final) - ThreadCount(reference)
]

JREs used in comparison are:
  1. Sun 1.6.0:
      java version "1.6.0"
     Java(TM) SE Runtime Environment (build 1.6.0-b105)
     Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)

  2. Harmony-r555193
     Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or
its licensors, as applicable.
     java version "1.5.0"
     pre-alpha : not complete or compatible
     svn = r555193, (Jul 11 2007), Linux/ia32/gcc 3.4.2, release build
 
  3. apache-harmony-hdk-r555580-windows-x86-32-snapshot
     Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or
its licensors, as applicable.
     java version "1.5.0"
     pre-alpha : not complete or compatible
     svn = r555256, (Jul 11 2007), Windows/ia32/msvc 1310, release build

Test was performed 4 times on the following configurations:
    a. -client (or -Xem:client)
    b. -server (or -Xem:server)
    c. -server -Xss128k
    d. -server -Xms64M -Xmx64M -Xss128k

Observations (details below):
    1. Harmony @ Linux x86_64 consumes 10 Mb per empty thread regardless of -Xss setting
    2. Harmony @ Linux x86 consumes 2 Mb per empty thread regardless of -Xss setting
    3. Harmony @ Windows x86 works well and tunable via -Xss
    4. Harmony @ Windows x86_64 works well and tunable via -Xss

    5. Simple stack overflow test (attached  - StackTest.java) shows than the stack size is
changed via -Xss option on Linux too, but memory footprint remains that huge.

This issue is critical since Harmony is unable to run significant amount of multi-threaded
applications on Linux.

Details:

On Linux64:
     Linux linux64testbox 2.6.9-55.ELsmp #1 SMP Fri Apr 20 16:36:54 EDT 2007 x86_64 x86_64
x86_64 GNU/Linux
 
     Sun:
        a. 12077 threads, 329 Kb/thread 
        b. 9121 threads, 329 Kb/thread 
        c. 21505 threads, 137 Kb/thread 
        d. 29118 threads, 136 Kb/thread 

     Harmony-r555193:
        a. 332 threads, 10767 Kb/thread 
        b. 352 threads, 10618 Kb/thread 
        c. 352 threads, 10648 Kb/thread 
        d. 351 threads, 11240 Kb/thread 

      Notice 10 Mb per empty thread!

On Linux32:
      Linux linux32testbox 2.6.5-7.97-smp #1 SMP Fri Jul 2 14:21:59 UTC 2004 i686 i686 i386
GNU/Linux

     Harmony-r555193:
        a. 752 threads, 2061 Kb/thread 
        b. 816 threads, 2059 Kb/thread 
        c. 746 threads, 2061 Kb/thread 
        d. 949 threads, 2061 Kb/thread 

     apache-harmony-hdk-r555580-linux-x86-32-snapshot:
        a. 752 threads, 2061 Kb/thread 
        b. 816 threads, 2059 Kb/thread 
        c. 746 threads, 2061 Kb/thread 
        d. 949 threads, 2061 Kb/thread 

On Windows x86:

     apache-harmony-hdk-r555580-windows-x86-32-snapshot:
        a. 2062 threads, 577 Kb/thread 
        b. 2584 threads, 569 Kb/thread 
        c. 8983 threads, 157 Kb/thread 
        d. 10466 threads, 153 Kb/thread 

On Windows x86_64:

     apache-harmony-hdk-r555580-windows-x86-32-snapshot:
        a. 4185 threads, 840 Kb/thread 
        b. 4176 threads, 836 Kb/thread 
        c. 8194 threads, 419 Kb/thread 
        d. 8679 threads, 415 Kb/thread 




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message