[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Support for thread-pools (log/lock-threads) Ryan How Sun Feb 19 09:00:28 2012

Maybe the OS or something is smarter than it seems... I've had thousands of open threads and memory stays a lot lower than 1MB / thread. If it didn't my little laptop would chug!

I just ran a test then...

    public static void main(String[] args) {
        for (int i = 0; i < 1000; i++) {
            new Thread(new Runnable() {
                public void run() {
                    try {
                    } catch (InterruptedException e) {


Windows Task Manager reports memory at 50,476K
Swap space rose by 70MB.

I mean, it is a little high for a program that does nothing, but it isn't 1GB!

On 19/02/2012 5:42 AM, cowwoc wrote:
# The default stack size for threads under 64-bit JVMs is 1MB. Source: http://www.oracle.com/technetwork/java/hotspotfaq-138619.html # At 64-bit with 512k stack (notice, this is smaller than the default) he is still limited to 32k threads and a whopping 16GB of memory gets used. You never even more memory to keep the heap around.

You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at