Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #1315

Open
limbo200 opened this issue Nov 13, 2023 · 1 comment

Comments

@limbo200
Copy link

Hello,

I'm encountering a memory allocation issue despite increasing the memory allocated to Node.js (using the command export NODE_OPTIONS="--max-old-space-size=12192"). I am attempting to compare two PHP files, each containing approximately 3,600 lines of code. However, I encounter the following error message:

<--- Last few GCs --->

[196:0x6b31660]    82235 ms: Mark-sweep 12138.4 (12228.2) -> 12127.9 (12234.9) MB, 272.8 / 0.0 ms  (average mu = 0.531, current mu = 0.280) allocation failure; scavenge might not succeed
[196:0x6b31660]    82522 ms: Mark-sweep 12143.7 (12234.9) -> 12132.3 (12240.2) MB, 273.4 / 0.0 ms  (average mu = 0.356, current mu = 0.048) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb7b150 node::Abort() [node]
 2: 0xa8c89a  [node]
 3: 0xd62ea0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xd63247 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xf40945  [node]
 6: 0xf52e2d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 7: 0xf2d52e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 8: 0xf2e8f7 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 9: 0xf0faca v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x12d33bf v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x17001f9  [node]
@rien
Copy link
Member

rien commented Nov 15, 2023

Hi @rgrcnh, this could happen for very large and contain some problematic code blocks (repeating fragments can be an issue, see #820). However, 3600 lines of code should still be doable.

Can you try increasing the k-gram and window size? For example, you could run:

dolos -f web -l php -k 100 -w 100 <file1.php> <file2.php>

Is it possible to mail me these two (anonymized) PHP files? So I can analyze and profile Dolos with them locally. You can mail them to [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants