Memory Management in Java (Stringbuffer, append) 1st
Memory management in Java
When we input data using the print function we usually use "print sysout" however that is the most inefficient way not to control memory management.
(example 1)
(Ex 1) is a representative example of not managing CPU memory in-efficiently.
The understanding basic data structure is the best way to understand why this problem occurs and how to figure out the issues. When we upload the data from the storage in a 'Heap' area, usually CPU overwrites first data with the after at the same time they will occupy double space in the memory causing a waste of the memories. (:Yellow mark)
The best way to solve the issue is by using of Stringbuffer.
Stringbuffer is temporary storage to ensure the data is saved and Stringbuffer’s algorithm is helpful to manage data structure data piece by piece.
Example 2_Waste of memory
Comments
Post a Comment