Skip to Content
Java Memory Management
book

Java Memory Management

by Maaike van Putten, Dr. Seán Kennedy
November 2022
Intermediate to advanced
146 pages
3h 16m
English
Packt Publishing
Content preview from Java Memory Management

4

Freeing Memory with Garbage Collection

Allocated memory needs to be deallocated when it is no longer needed. In some languages, the developer needs to take care of that. In some others, such as Java, this happens automatically. For Java, the garbage collector does this. The deallocation of memory is necessary for an application to keep running. Without the ability to free memory when it is no longer needed, we would only be able to allocate memory once, and eventually, we would run out of memory. In this chapter, we will be learning more about freeing memory on the heap using the garbage collector.

This can be a tough topic! Before you are ready for this chapter, you’ll need to have a clear understanding of the heap space. Again, we’ll visualize ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Concurrency in Practice

Java Concurrency in Practice

Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, Doug Lea
Troubleshooting Java

Troubleshooting Java

Laurentiu Spilca
The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

Benjamin Evans, Martijn Verburg, Jason Clark
Java Coding Problems

Java Coding Problems

Anghel Leonard

Publisher Resources

ISBN: 9781801812856Supplemental Content