Video is locked.

Unlock this course with a free trial

Join today to access over 15,000 courses taught by industry experts.

Java Memory Management

Generational garbage collection

From the course: Java Memory Management

  • Course details

    By taking the time to learn how memory works in Java, you can avoid introducing problems in your code, as well as more effectively find and fix any memory errors that still occur. In this hands-on course, join instructor Matt Greencroft as he details how memory works in Java. Matt goes over essential concepts such as the roles of the stack and the heap, escaping references, garbage collection, detecting soft leaks, and more. Plus, he lends a real-world context to these concepts by demonstrating how to hunt for—and fix—a memory leak in a sample Java web application. While Matt works with Eclipse and Java 8 throughout the course, the material he covers is valid for any IDE and Java 6 and above.

    Instructor

    • Click here to view Matt Greencroft’s instructor page

      Matt Greencroft

      Director at Capability Training & Management Ltd

      • Matt Greencroft is a full-time trainer and software development consultant.

        Matt works to design and deliver a range of Java-related training courses for the Virtual Pair Programmers brand. With these courses, he helps everyone from beginners to Java experts boost their coding skills. In addition to tech education, Matt uses his gift for public speaking as a professional toastmaster and master of ceremonies.

    Skills covered in this course

  • Introduction

    - [Instructor] So this is the basic process that modern garbage collectors follow, but it's not the full story. The problem with what we have just seen is that if there are lots of objects which are not garbage, then because garbage collection is a stop the world event, our application is paused while the garbage collection process runs, then the users of our application will probably notice that our application has frozen, perhaps for a few seconds at a time. This wouldn't be acceptable, so to avoid this, we have something called generational garbage collection. The starting point for understanding generational garbage collection is that most objects in Java live for a very short period of time. If an object survives one garbage collection, then its more likely to live forever. We need to remember, it's faster to collect when there's a lot of garbage, when there are fewer objects that are surviving. So generational garbage collection is a way of organizing the heap. The heap is…

  • Practice while you learn with exercise files

    Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.

    Download the exercise files for this course. Get started with a free trial today.

  • Download courses and learn on the go

    Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.

    Watch this course anytime, anywhere. Get started with a free trial today.

Contents