Set any global variables to null to allow them to be garbage collected
Removed any elements that were $compiled and had references to them stored globally
Split up the test run into 5 buckets, controllers, directives, states, services, and other
Additional Comments:
There are still some global variables in nested describes which are not being set to null because I scripted the refactor for the most part. Only globals in the topmost describe were nullified
Same goes for compiled directives, there may be some sneaky ones that were missed, but not many.
Phantom poorly implements garbage collecting if at all, so splitting up the test runs helps with speed and memory consumption
Results:
Before: test run would allocate a whopping 1.5 GB of memory and would occasionally crash Jenkins and slow down my machine
After test refactor: 850 MB still not ideal but much better
After test refactor + test segmentation: 360 MB even better, still room for improvement but definitely good for now
fixes #1321
Summary of Changes:
null
to allow them to be garbage collected$compile
d and had references to them stored globallycontrollers
,directives
,states
,services
, andother
Additional Comments:
Results: Before: test run would allocate a whopping 1.5 GB of memory and would occasionally crash Jenkins and slow down my machine After test refactor: 850 MB still not ideal but much better After test refactor + test segmentation: 360 MB even better, still room for improvement but definitely good for now