60183d0dc4
There's been some talks about weird failures on DDC and there was ideas that this was caused by some sort of leak (of kernel libraries). I haven't really found any "meaningful" leaks that should be able to cause that. What I have found is this: * a temporary leak where the vm seemingly gets "one behind". That's fixed here by creating a class for the ddc batch compiler, having things in field variables etc. It shouldn't influence results. * a leaks via https://github.com/dart-lang/sdk/issues/51317 --- but that's just wasted memory, I can't see how that should influence results. * a leak via kernels dummy nodes --- again it shouldn't influence results (unless we're leaving dummy nodes in the output somewhere --- which, considering I'm removing that in my test by null'ing out the parent pointer and stuff still working I'm guessing we're not). * another leak via some ports map after a crash, but that seems to go away on its own (the VM cleaning it up later than I think it should?). Again it shouldn't influence anything other than (temporary) wasted space. I've wired up the leak testing stuff into the DDC batch mode so that one can go into "leak test mode" by doing `export DDC_LEAK_TEST="true"` on the terminal (I think `set DDC_LEAK_TEST="true"` on Windows). Then one could run test.py, say ``` python3 tools/test.py -t10000 -c dartdevk --nnbd weak -m release \ -r none --enable-asserts --no-use-sdk -j 1 co19/LanguageFeatures/ ``` and attach the leak tester via ``` out/ReleaseX64/dart \ pkg/front_end/test/vm_service_for_leak_detection.dart --dart-leak-test ``` Currently this finds - if I recall correctly - 3 leaks (I think all via the ports map stuff), but it all goes away again on it's own, so likely another case of the VM somehow getting "one behind". Change-Id: Idbf057e3aedfe7b256370f90ddf72f1f8e6798a8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282027 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Reviewed-by: Nicholas Shahan <nshahan@google.com>