A)
->implicit (automatic) release of dynamic allocated memory (object) is known as garbage collection.
->A sub process of JVM known as garbage collector does this job. In c and c++ applications, application developer is responsible to explicitly release dynamic allocated memory. If forgot it leaks to memory leak in java, the problem doesn’t rise.
Additional information:
Memory leaks mean that dynamic allocated memory which is not released that is not useful to another application. That is known as unreachable object.
In c – malloc function allocate dynamic memory.
Free function used for the dynamic memory is released.
In c++ New and delete used for dynamic memory allocate and release.
Comments
Post a Comment