Chrome DevTools: DOM Node Count Test

Possible bug in Timeline → Memory → Counters → DOM Node Count pane on OS X?

Theory: GPU / hardware-accelerated layers may not be removed from the DOM Node Count pane on OS X after proper garbage collection.

Screenshots and detail in this Flickr set.

Chromium ticket #304689.

| |

Test case

  1. Load page with Chrome DevTools open, go to Timeline → Memory view and start recording.
  2. Click the Create nodes button perhaps 10 times. Memory use will increase as DOM nodes and JS objects are created.
  3. Click Destroy nodes to remove DOM nodes and JS → DOM references.
  4. Click the trash can (collect garbage) icon in Chrome DevTools. Memory use and DOM Node Count should decrease.
  5. Repeat the process, clicking Create nodes (w/CSS transform), followed by Destroy nodes and then the trash can in Chrome DevTools. Observe that memory use drops, but DOM Node Count may not in this case.

Example Screenshots

Timelines showing effects of creation, removal + GC of regular nodes, followed by nodes with -webkit-transform: translate3d() applied.

Windows XP: Expected behaviour.

Chrome DevTools (WinXP), Timeline Memory View - DOM Node Count

OS X: GPU-accelerated layers remain in DOM Node Count after GC, despite memory decrease + lack of Disconnected DOM in Heap Snapshots.

Chrome DevTools, OS X: Timeline → Memory → DOM Node Count bug(?) triggered by GPU-accelerated elements

General Disclaimer

"AFAIK", hardware acceleration involves a bit of black magic and support can vary. I'm not familiar with the details, but applying CSS transforms seems to trigger the DOM Node Count behaviour on OS X.

Observed on Chrome Canary 32.0.1661.0 on OS X 10.8.5. Originally posted October 5th, 2013.