Learn how memory works in Java. In this hands-on course, explore fundamental concepts to help you optimize your code and quickly find and fix any memory errors that still occur.
Overview
Syllabus
Introduction
- Introduction
- Why memory is important
- The role of the stack
- The role of the Heap
- Passing variables by value
- How objects are passed
- The final keyword
- Memory exercise
- Exercise walkthrough
- What are escaping references?
- An escaping references example
- How to avoid escaping references with collections
- Avoiding escaping references with custom objects, part 1
- Avoiding escaping references with custom objects, part 2
- Escaping references exercise
- Exercise walkthrough
- String pools
- Garbage eligibility
- The gc() and finalize() methods
- Understanding what soft leaks are
- Detecting soft leaks
- Mark and sweep
- Generational garbage collection
- Using the Visual GC tool to view a soft leak
- Using the Memory Analyzer tool
- PermGen and the Metaspace
- Heap size
- PermGen size
- Garbage collection and generation sizes
- Generating heap dumps
- Choosing a garbage collector
- Introducing the example application
- Monitoring the application
- Fixing a memory leak
- Course summary
Taught by
Matt Greencroft