Chapter 24 ■ Optimizing game assets and COde, and game prOfiling Using netBeans
Picking a square invokes garbage collection to load a quadrant image, CPU thread processing spikes
when a square is picked representing garbage collection, event processing, Q&A, and score processing, as
shown in Figure 24-20.
Figure 24-19. The board spin uses garbage collection to load images into memory and threads to pick a
random number
Figure 24-20. A square pick uses garbage collection to load imagery into memory and uses threads to display
UI panels
Picking the answer, on the other hand, invokes zero garbage collection to load imagery, as you can
see in Figure 24-21. It uses little (almost nothing) CPU overhead to increment the Score panel and display
Text assets.