andywer / ideabox

Place to collect techy ideas and get feedback.
1 stars 1 forks source link

Memory leakage testing #3

Closed andywer closed 7 years ago

andywer commented 8 years ago

There should be an easy way to test your code for memory leaks. Basically a straight-forward, generic way to write tests for memory inspection using memwatch.

Scenario: memwatch (https://github.com/marcominetti/node-memwatch) is used on your (existing) unit tests which are run multiple times each. (Initial idea, suffers from some fundamental issues)

Idea

Write memory-leakage tests as new test type. Set up environment using a before hook, write tests, finally heap snapshotting and leak detection.

To Be Defined

andywer commented 7 years ago

Difference to drool: It's about testing code in general. Drool is only for DOM operations in the browser.

andywer commented 7 years ago

Current state after ~2h of thinking and hacking:

bildschirmfoto 2016-12-23 um 23 36 40 bildschirmfoto 2016-12-23 um 23 37 18
andywer commented 7 years ago

The eagle has landed: https://github.com/andywer/leakage

Closing this idea 😊