Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

C++ & Java memory management!!

Thu Jun 28, 2007 5:38 am

The difference between C++ and java memory management:
-------------------------------------------------------------


In C and C++, any memory that is allocated on the heap (e.g. using malloc or new) must be explicitly freed by the programmer (e.g. using free or delete). Forgetting to free memory leads to memory leaks, and in long-running programs can lead to the memory usage of the program growing very large.

Java provides garbage collection, meaning that memory is freed automatically when it is no longer reachable by any references. This prevents memory leaks, but can lead to pauses in execution while the garbage collector runs. Also, there is no promise of timely destruction in Java.



Post a reply
  Related Posts  to : C++ & Java memory management!!
 how to create a photo management system using java     -  
 Java Library Database Management System Project     -  
 GDI memory leaks detection     -  
 MATLAB clear memory     -  
 Memory leak detection in C++     -  
 problem with memory alocation     -  
 subtract number from memory locations     -  
 Latest XML parsing/memory usage benchmark     -  
 application on hotel management system     -  
 need project code for time and work management     -  

Topic Tags

Java Basics