question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unittest discovery out of memory

See original GitHub issue

Environment data

  • VS Code version: 1.60.2

  • Extension version (available under the Extensions sidebar): v2021.9.1191016588

  • OS and version: macOS Big Sur v11.5.2

  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.1

  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv

  • Value of the python.languageServer setting: Pylance

  • Extension Version working: v2021.8.1159798656

  • Extension Version it stopped working: v2021.9.1191016588 up until latest

Expected behaviour

Clicking on the Testing icon results in the list of tests

Actual behaviour

VSCode crashes and says that I need to reload the window.

Steps to reproduce:

  1. Open the project
  2. Click on test icon
  3. Crashes.

We have 1000+ test cases, I think VSCode just runs out of memory with this version of the extension.

Logs

<--- Last few GCs --->[77456:0x5000000000] 119227 ms: Scavenge (reduce) 3798.8 (3951.0) -> 3798.8 (3951.8) MB, 6.6 / 0.0 ms (average mu = 0.922, current mu = 0.825) allocation failure [77456:0x5000000000] 119248 ms: Scavenge (reduce) 3799.9 (3951.8) -> 3799.4 (3951.8) MB, 6.0 / 0.0 ms (average mu = 0.922, current mu = 0.825) allocation failure [77456:0x5000000000] 119270 ms: Scavenge (reduce) 3800.1 (3951.8) -> 3800.0 (3953.3) MB, 6.7 / 0.0 ms (average mu = 0.922, current mu = 0.825) allocation failure <--- JS stacktrace --->FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory 1: 0x103c96a35 node::Buffer::New(v8::Isolate*, char*, unsigned long, void (*)(char*, void*), void*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 2: 0x103c96bd6 node::OnFatalError(char const*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 3: 0x104968023 v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 4: 0x104967f7f v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 5: 0x104a136c5 v8::internal::Heap::PreciseCollectAllGarbage(int, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 6: 0x1016d17b2 v8::internal::MarkCompactCollector::EnsureSweepingCompleted() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 7: 0x1016d0e71 v8::internal::MarkCompactCollector::EnsureSweepingCompleted() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 8: 0x1016d0a9b v8::internal::MarkCompactCollector::EnsureSweepingCompleted() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 9: 0x1016e9aeb v8::internal::MarkCompactCollector::EnsureSweepingCompleted() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]10: 0x102d34486 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]11: 0x102d34813 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]12: 0x1016d77ba v8::internal::MarkCompactCollector::EnsureSweepingCompleted() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]13: 0x1016d6d63 v8::internal::MarkCompactCollector::EnsureSweepingCompleted() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]14: 0x1016c621f v8::internal::LocalHeap::InvokeGCEpilogueCallbacksInSafepoint() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]15: 0x1016c3c90 v8::internal::LocalHeap::InvokeGCEpilogueCallbacksInSafepoint() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]16: 0x10169df50 v8::internal::Heap::MaxRegularHeapObjectSize(v8::internal::AllocationType) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]17: 0x10166c9e2 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]18: 0x1018c040e v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]19: 0x1018c3f1c v8::internal::String::SlowEquals(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::String>) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]20: 0x1019ac4c2 v8::internal::Runtime::SetObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin, v8::Maybe<v8::internal::ShouldThrow>) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]21: 0x50000b22b8 Extension host terminated unexpectedly. Code: null Signal: SIGABRT _onExtensionHostCrashed @ abstractExtensionService.ts:615 _onExtensionHostCrashed @ extensionService.ts:252 _onExtensionHostCrashOrExit @ abstractExtensionService.ts:607 (anonymous) @ abstractExtensionService.ts:597 fire @ event.ts:577 _onExtHostProcessExit @ localProcessExtensionHost.ts:535 (anonymous) @ localProcessExtensionHost.ts:289 emit @ events.js:315 ChildProcess._handle.onexit @ internal/child_process.js:277

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
karthiknadigcommented, Oct 15, 2021

There was a rendering bug that was fixed in VS Code when we tried to add a large number of tests to the test tree. That potentially addressed this as well.

1reaction
ZackTherriencommented, Sep 23, 2021

In the latest version I get the following error in the Devtools

<--- JS stacktrace --->FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit testing memory leaks using dotMemory Unit
This standalone launcher will wrap the unit test process in a dotMemory profiling session and provides the memory snapshot information our ...
Read more >
Python unittest and test discovery - Stack Overflow
A testcase is created by subclassing unittest.TestCase. The three individual tests are defined with methods whose names start with the letters ...
Read more >
Preventing memory-use regressions - Apple Developer
Preventing memory-use regressions. Measure the memory that your app's features use, and detect increases by using XCTest performance tests.
Read more >
Using unit tests to identify and avoid memory leaks in Swift
Managing memory and avoiding leaks is a crucial part of building any kind of program. This week, let's take a look at how...
Read more >
Executing Individual JUnit test case in Eclipse : Out of memory ...
Junit tests are run in a different vm as the Ee IDE. So it is that vm that is out of memory and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found