Debug toolbar out of memory fix, closes #1011.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Fixed tickets | #1011
| License       | MIT