Forgot your password?
typodupeerror

Comment Re:Java is slow (Score 2, Informative) 632

Did anyone try running the obvious test....
public class RunLoop
{
public static void main( String[] args )
{
while ( true )
{
Object o = new Object();
o = null;
}
}
}
You can run this till the cows come home and you won't run out of memory. Running the JVM with 64MB and -verbosegc
....
[GC 606K->94K(1984K), 0.0004234 secs]
.... quizillion times....
[GC 606K->94K(1984K), 0.0004110 secs]
....
As you can see:
  1. The VM does free memory in "real-time" ( whatever that may mean )
  2. The amortized amount of memory is zero ( it keeps falling back to the base 94K used for the base java classes.
If you realy want to know how the VMs memory works and how to tune it, you could do worse than read the Hotspot GC Notes. Agreed that Java is not the greatest language there could be, but it is the best mainstream language for a majority of applications. BTW, this test was done on a rather obsolete PIII
Memory: 127544k/130944k available (1008k kernel code, 412k reserved, 1636k data, 64k init)
DENTRY hash table entries: 262144 (order: 9, 2097152 bytes)
Buffer-cache hash table entries: 131072 (order: 7, 524288 bytes)
Page-cache hash table entries: 32768 (order: 5, 131072 bytes)
VFS: Diskquotas version dquot_6.4.0 initialized
CPU: Intel Pentium III (Katmai) stepping 03

Slashdot Top Deals

Every successful person has had failures but repeated failure is no guarantee of eventual success.

Working...