Java performance Issues (II) - Memory

30 January 2008

Java program requires more memory resources and is slow when compared with most of the natively compiled modern day programming languages such as C or C++. This is becuase the Java Library must be loaded in to memory before program execution takes place. In addition to that, both the Java binary and native recompilations must be in the memeory at the same time. Further, Java Virtual Machine (JVM) also requires memory recources for it self. These all add and Java memory usage is high when comapred to C, C++ etc.

Java has its own memory maangement. However, in certain situations memory must be released explicitely as it is done in C++. For example, in JDBC database connections you need to release the memory. In short, Java does not manage all resources for memory.

To avoid allocation errors such as memory leaks, Java (also) has garbage collection. As a result, in a way, in Java memory management is automatic.

In C++, programmers are allowed to control where objects are stored. This facilty is not available in Java which always allocates objects on heap. Only compiler can optimize this.

del.icio.us:Java performance Issues (II) - Memory  digg:Java performance Issues (II) - Memory  spurl:Java performance Issues (II) - Memory  wists:Java performance Issues (II) - Memory  simpy:Java performance Issues (II) - Memory  newsvine:Java performance Issues (II) - Memory  blinklist:Java performance Issues (II) - Memory  furl:Java performance Issues (II) - Memory  reddit:Java performance Issues (II) - Memory  fark:Java performance Issues (II) - Memory  blogmarks:Java performance Issues (II) - Memory  Y!:Java performance Issues (II) - Memory  smarking:Java performance Issues (II) - Memory  magnolia:Java performance Issues (II) - Memory  segnalo:Java performance Issues (II) - Memory  gifttagging:Java performance Issues (II) - Memory

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Java performance Issues (II) - Memory

Leave a Reply