1.String is more memory space than stringbuffer, when stitching strings
Cause: String The actual amount of memory consumed by this object does not correspond to its own number of bytes.
Conclusion: It should be used less string, especially the string "+ =" operation, not only the original string object
It is not possible to continue to use, but it also produces multiple new objects, which makes it a higher memory footprint.
2. Two-dimensional arrays occupy more memory space than one-dimensional arrays
Cause: For a two-dimensional array, it takes up much more memory space than
It opens up the number of array elements.
3. Increase memory query speed (hash table) with HashMap
4. Increase the speed of array interception with "arrayCopy ()"
Example: System.arraycopy (oldarray,100,newarray,0,120);
Copies an array from the specified source array, starting at the specified location and ending at the specified position in the destination array.
Java Performance optimization