You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Aleksey Shipilev (JIRA)" <ji...@apache.org> on 2007/07/18 11:58:04 UTC

[jira] Created: (HARMONY-4489) [drlvm][threading] Threads consume too much memory

[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.


[jira] Updated: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev updated HARMONY-4489:
--------------------------------------

    Attachment: HARMONY-4489.patch

HARMONY-4489.patch
Proposed patch which solves the problem.

After applying this patch on Linux64:

Harmony-r555193, -Xms64M -Xmx64M -Xss128k
 13705 threads created, 250 Kb per thread

> [drlvm][thread] 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
>         Attachments: HARMONY-4489.patch, StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Commented: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "Ilya Berezhniuk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516228 ] 

Ilya Berezhniuk commented on HARMONY-4489:
------------------------------------------

I've analyzed patches suggested in this JIRA and in HARMONY-1907.
Although several modules are access pthread directly, only hythread linkage can essentially affect threading behavior. So I experimented with hythread static/shared linkage with pthread.
Here is the result:

1) Clean build:
ia32:
~~~~~
Test.class starts 856 threads and hangs

em64t:
~~~~~
Test starts 9989 (sometimes >10000) threads and hangs

2) Shared linkage with pthread:
ia32:
~~~~~
Test starts ~3500 threads and hangs. Introduces 6 failures in 'build test'.

em64t:
~~~~~
Test starts 9955 threads and crashes.

3) Static linkage with pthread:
ia32:
~~~~~
Test starts ~3500 threads and hangs.

em64t:
~~~~~
Test starts 9989 (sometimes >10000) threads and hangs

4) I tried couple of other combinations, tried to remove 'export-dynamic', remove pthread linkage from other modules etc., but have not achieved results better than with HARMONY-4489 patch.

Thus the best choice is patch suggested in this JIRA.
But even this patch has some disadvantages. 'build test' was successfully passed for both Linux/ia32 and Linux/em64t (skipping tests which were failed on clean build). Classlib unit tests were also successful for Linux/em64t. But on Linux/ia32 using this patch leads to strange results:
- 2 swing tests which were stably failed on clean build have become passed;
- 3 swing tests have become stably failed;
- Many swing tests have become intermittently failed. I cannot catch these fails on clean build.


> [drlvm][thread] 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
>         Attachments: HARMONY-4489.patch, HARMONY-4489.patch, StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Updated: (HARMONY-4489) [drlvm][threading] Threads consume too much memory

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev updated HARMONY-4489:
--------------------------------------

    Attachment: Test.java

Thread test

> [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
>         Attachments: StackTest.java, Test.java
>
>
> 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.


[jira] Updated: (HARMONY-4489) [drlvm][threading] Threads consume too much memory

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev updated HARMONY-4489:
--------------------------------------

    Description: 
Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
A simple test (Test.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 




  was:
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 





Synchronized filenames.

> [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
>         Attachments: StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Commented: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "Pavel Rebriy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514892 ] 

Pavel Rebriy commented on HARMONY-4489:
---------------------------------------

The bus is similar to HARMONY-1907 and it also has a fixing patch (don't applied to the latest revision). But the idea of fixing is a different from this one. 

Aleksey could you please look at it.

> [drlvm][thread] 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
>         Attachments: HARMONY-4489.patch, HARMONY-4489.patch, StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Updated: (HARMONY-4489) [drlvm][threading] Threads consume too much memory

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev updated HARMONY-4489:
--------------------------------------

    Attachment:     (was: Test.java)

> [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
>         Attachments: StackTest.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Updated: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev updated HARMONY-4489:
--------------------------------------

    Patch Info: [Patch Available]

Marking issue as "Patch available".

> [drlvm][thread] 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
>         Attachments: HARMONY-4489.patch, HARMONY-4489.patch, StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Updated: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Fursov updated HARMONY-4489:
------------------------------------

    Summary: [drlvm][thread] Threads consume too much memory  (was: [drlvm][threading] Threads consume too much memory)

> [drlvm][thread] 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
>         Attachments: StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Commented: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "Pavel Afremov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514182 ] 

Pavel Afremov commented on HARMONY-4489:
----------------------------------------

Patch fixes -Xss issue on both linux platforms (x86-32 and x86-64) on my machines.


> [drlvm][thread] 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
>         Attachments: HARMONY-4489.patch, StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Updated: (HARMONY-4489) [drlvm][threading] Threads consume too much memory

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev updated HARMONY-4489:
--------------------------------------

    Attachment: Test.java

Test updated.

> [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
>         Attachments: StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Closed: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "weldon washburn (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

weldon washburn closed HARMONY-4489.
------------------------------------

    Resolution: Fixed

patch has been applied

> [drlvm][thread] 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
>         Attachments: HARMONY-4489.patch, HARMONY-4489.patch, StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Updated: (HARMONY-4489) [drlvm][threading] Threads consume too much memory

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksey Shipilev updated HARMONY-4489:
--------------------------------------

    Attachment: StackTest.java

Simple stack overflow test.

> [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
>         Attachments: StackTest.java, Test.java
>
>
> 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.


[jira] Commented: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514935 ] 

Aleksey Shipilev commented on HARMONY-4489:
-------------------------------------------

Pavel, basically HARMONY-1907 idea of fixing is the same, and my patch does similar thing - links pthreads as shared library for hythr.
I'd prefer to commit this atomic patch rather than complex outdated HARMONY-1907, as this is the minimal change that solves the problem.

> [drlvm][thread] 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
>         Attachments: HARMONY-4489.patch, HARMONY-4489.patch, StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.


[jira] Updated: (HARMONY-4489) [drlvm][thread] Threads consume too much memory

Posted by "Pavel Afremov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Afremov updated HARMONY-4489:
-----------------------------------

    Attachment: HARMONY-4489.patch

New smoke test was added to check creation and running thousands of the threads with small (256k) stack size.

> [drlvm][thread] 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
>         Attachments: HARMONY-4489.patch, HARMONY-4489.patch, StackTest.java, Test.java
>
>
> Harmony consumes too much memory for threads while running on Linux, either x86 or x86_64. 
> A simple test (Test.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.