Java Memory Management

Java Memory Management

English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 3 Hours | 480 MB

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.

Topics include:

  • How memory works in Java
  • Passing variables by value
  • How objects are passed
  • What are escaping references?
  • How to avoid escaping references with collections and custom objects
  • Garbage collection and generation sizes
  • Detecting soft leaks
  • Choosing a garbage collector
  • Tuning a virtual machine
  • Fixing a memory leak
Table of Contents

1 Introduction
2 Why memory is important
3 The role of the stack
4 The role of the Heap
5 Passing variables by value
6 How objects are passed
7 The final keyword
8 Memory exercise
9 Exercise walkthrough
10 What are escaping references
11 An escaping references example
12 How to avoid escaping references with collections
13 Avoiding escaping references with custom objects, part 1
14 Avoiding escaping references with custom objects, part 2
15 Escaping references exercise
16 Exercise walkthrough
17 String pools
18 Garbage eligibility
19 The gc() and finalize() methods
20 Understanding what soft leaks are
21 Detecting soft leaks
22 Mark and sweep
23 Generational garbage collection
24 Using the Visual GC tool to view a soft leak
25 Using the Memory Analyzer tool
26 PermGen and the Metaspace
27 Heap size
28 PermGen size
29 Garbage collection and generation sizes
30 Generating heap dumps
31 Choosing a garbage collector
32 Introducing the example application
33 Monitoring the application
34 Fixing a memory leak
35 Course summary