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 {
Thread.sleep(100000000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
}
}
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
http://groups.google.com/group/h2-database?hl=en.