You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sergey Kuksenko (JIRA)" <ji...@apache.org> on 2007/05/30 16:05:16 UTC

[jira] Created: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

[drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
-----------------------------------------------------------------------------------------------

                 Key: HARMONY-4001
                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Windows Server 2003 (32-bit)
            Reporter: Sergey Kuksenko
            Priority: Critical


Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
Even such empty threads as in the test.
This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
The test tries to run 3000 simultaneously threads (doing nothing).
RI pass the test succesfully.

Perfmon data shows the following:
- starting each thread adds (in average) 1.24M of memory to the process address space.
- so the test on 1636 thread reached 2G Windows limit and hung up. 

Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:597)
        at Test.main(Test.java:17)

1. DRLVM should have the similar option for managing thread stack size.
2. DRLVM should correctly throw exception in this case.
3. default stack size shoule be less then 1M.

I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.


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


[jira] Commented: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Sergey Kuksenko commented on HARMONY-4001:
------------------------------------------

This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads

> [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Updated: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

weldon washburn updated HARMONY-4001:
-------------------------------------

    Attachment: ManyThreadsTest.java

> [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: ManyThreadsTest.java, Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Commented: (HARMONY-4001) [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Pavel Afremov commented on HARMONY-4001:
----------------------------------------

Proposed patch fixes HARMONY-3627 and HARMONY-3640.

> [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> --------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: ManyThreadsTest.java, parametrized_stack.patch, Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Updated: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Sergey Kuksenko updated HARMONY-4001:
-------------------------------------

    Attachment:     (was: Test.java)

> [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Priority: Critical
>         Attachments: Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Closed: (HARMONY-4001) [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

weldon washburn closed HARMONY-4001.
------------------------------------

    Resolution: Fixed

build test2 should pass on most platforms (I was unable to get it to pass on my boxes)

> [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> --------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: ManyThreadsTest.java, parametrized_stack.patch, Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Assigned: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

weldon washburn reassigned HARMONY-4001:
----------------------------------------

    Assignee: weldon washburn

> [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Updated: (HARMONY-4001) [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Gregory Shimansky updated HARMONY-4001:
---------------------------------------

    Summary: [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).  (was: [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).)

> [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> --------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: ManyThreadsTest.java, Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Updated: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Sergey Kuksenko updated HARMONY-4001:
-------------------------------------

    Attachment: Test.java

test again

> [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Priority: Critical
>         Attachments: Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Updated: (HARMONY-4001) [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Peter Novodvorsky updated HARMONY-4001:
---------------------------------------

    Attachment: parametrized_stack.patch

this patch adds -Xss option and sets default stack size to 512k. you can experiment with setting lower stack size however other bugs begin to appear after that.

> [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> --------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: ManyThreadsTest.java, parametrized_stack.patch, Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Commented: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

weldon washburn commented on HARMONY-4001:
------------------------------------------

I hacked DRLVM os_thread.c then ran the attached version of ManyThreadsTest.java.

The modification to os_thread.c hardcodes _beginthreadex stacksize to be 16KB and 1MB.  Using Windows Task Manager, its not clear how much virtual memory an app actually allocates.  There is a column reporting "vm size" which shows substantially less memory consumed when running with the 16KB stack.

The bottom line on above analysis:  DRLVM creates a max of 1635 threads with either 16KB stack or 1MB stack.  If 1635 threads are not enough, then we probably have more problems to solve in addition to the stack size.

The stack size is set in jthread_create_with_function().  It looks like something is not working correctly with line 180:

... (attrs->stacksize)?attrs->stacksize:1024000,...

My guess is that line 180 is the root of the unchangeable 1MB stack size problem.


> [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Commented: (HARMONY-4001) [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Aleksey Shipilev commented on HARMONY-4001:
-------------------------------------------

On Linux the situation even worse: mentioned test was run on 
Linux chameleon 2.6.5-7.191-bigsmp #1 SMP Tue Jun 28 14:58:56 UTC 2005 i686 i686 i386 GNU/Linux

I've made more accurate measurements, taking as reference some point during the run - when VM has started but threads are not created. This point was used to throw away VM allocations from the consideration. I'm taking the data from /proc/<pid>/status during the run. Final metric was obtained as 

Kb-per-thread = [ VmSize(final) - VmSize(reference) ] / [ Threads(final) - Threads(reference) ];

Sun 1.5.0:

-client: 
  3594 threads, 519 Kb/thread

-server: 
  1661 threads, 519 Kb/thread

-server -Xss128k: 
  6359 threads, 136 Kb/thread

-server -Xms64M -Xmx64M -Xss128k: 
  13637 threads, 136 Kb/thread

Note that increasing in the thread count was achieved by limiting Java heap size.
As expected, default SS is 512k; changed by parameter reflect 128k.

And then, Harmony:

-Xem:client: 
  752 threads, 2060 Kb/thread

-Xem:server: 
  742 threads, 2058 Kb/thread

-Xem:server -Xms64M -Xmx64M: 
  839 threads, 2047 Kb/thread

So, on Linux there are 2 megabytes per thread!

> [drlvm][thread] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> --------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: ManyThreadsTest.java, Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Updated: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Sergey Kuksenko updated HARMONY-4001:
-------------------------------------

    Attachment: Test.java

The test is attached.

> [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Priority: Critical
>         Attachments: Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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


[jira] Commented: (HARMONY-4001) [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).

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

Peter Novodvorsky commented on HARMONY-4001:
--------------------------------------------

please, make this bug non-critical. problem of not changable stack size is very well known. and this is duplicate.

> [drlvm][threading] DRLVM can't start more then ~1600 threads due to memory consumption (win32).
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4001
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4001
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows Server 2003 (32-bit)
>            Reporter: Sergey Kuksenko
>            Assignee: weldon washburn
>            Priority: Critical
>         Attachments: Test.java
>
>
> Attached test shown that DRLVM is not avaliable to have more then ~1600 threads running simultaneously.
> Even such empty threads as in the test.
> This bug is critical to running SpecJAppServer2004 because of even simple txRate=100 needs ~1300 running threads.
> The test tries to run 3000 simultaneously threads (doing nothing).
> RI pass the test succesfully.
> Perfmon data shows the following:
> - starting each thread adds (in average) 1.24M of memory to the process address space.
> - so the test on 1636 thread reached 2G Windows limit and hung up. 
> Setting to Sun1.6 -Xss1M options which significially increase stack size for each thread leads to failure too (after 1827 thread). But RI throws the follwoing exception:
> Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at Test.main(Test.java:17)
> 1. DRLVM should have the similar option for managing thread stack size.
> 2. DRLVM should correctly throw exception in this case.
> 3. default stack size shoule be less then 1M.
> I found that "vm\thread\src\thread_java_basic.c" has harcoded default thread stack size as 1M. But setting it to 16K doesn't change the test behavior and even in this case I can see with perfmon that each thread use 1.24M.

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