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.

Heap error gets thrown regardless of include/exclude - Process memory threshold reached.

See original GitHub issue

Bug

Current Behavior

I used to be on the cli version 0.12.3 and not run into any issues, but after upgrading recently to 0.12.6 I have started seeing the following error whenever I try to bring up my garden dev in local.

Process memory threshold reached. This most likely means there are too many files in the project, and that you need to exclude large dependency directories. Please see https://docs.garden.io/using-garden/configuration-overview#including-excluding-files-and-directories for information on how to do that.
If this keeps occurring after configuring exclusions, please file an issue at https://github.com/garden-io/garden/issues.

I’ve tried adding include: [] to all my modules in the project but still seem to run into the issue. I am thinking it’s probably due to the pure size of the project I am trying to bring up – and I happen to fall in the 85%-100% range heap usage range. My project already respects the ignore files also -

dotIgnoreFiles:
  - .gardenignore
  - .gitignore

I’ve tried setting an env var via export NODE_OPTIONS=--max_old_space_size=4096 to increase node’s max memory limit but that somehow break garden altogether where i can’t even do garden --version.

Expected behavior

  • There should be an option to increase the max heap size limit in case it was ever needed.
  • The error message should be more straightforward – more details in the Workaround section.

Reproducible example

  1. export NODE_OPTIONS=--max_old_space_size=4096 in the shell
  2. Run garden --version

Expected: version output

Actual: nothing

Workaround

  1. Downgrading manually to 0.12.3 version that did not have the heap check. (may only work if your heap usage falls between 85% but still not using up all 100%)
  2. I’ve found out that by removing certain duplicate dependencies e.g., if my module F had dependencies like
dependencies:
- A
- B
- C

and B happened to depend on A already, and C happened to depend on B, then just depending on C seems to relieve the issue for me. Perhaps, this is the real culprit of the issue – my listing out all dependencies in my project was trying to make it more apparent what the module relied on.

Suggested solution(s)

  • It seems like the heap error could possibly result from duplicated (inferred) dependencies being listed in some modules as opposed to what the error message indicates – e.g., include/exclude files.
  • Allow for increasing the max heap for the garden engine.

Your environment

  • OS: macOS
  • How I’m running Kubernetes: docker

garden version - 0.12.6

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
edvaldcommented, Nov 25, 2020

Aha, I see, thanks! I think that narrows it down for sure.

1reaction
thsigcommented, Sep 30, 2020

@kyungkimsf Thanks for flagging this! We’ll look into it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

KB-1411 Memory threshold reached during output conversion
KB-1411 Memory threshold reached during output conversion ... This error is thrown when a query rule is pulling in more data than the...
Read more >
3.2 Understand the OutOfMemoryError Exception
This exception is typically thrown because the amount of live data barely fits into the Java heap having little free space for new...
Read more >
vite build error: out of memory · Issue #2433 - GitHub
I could only get it to work with node 15 on an Apple M1 without having to increase the max_old_space_size value. Either node...
Read more >
How to Fix JavaScript Heap Out of Memory Error - MakeUseOf
This error usually occurs when the default memory allocated by your system to Node. js is not enough to run a large project....
Read more >
export node_options=--max_old_space_size=4096 - You.com
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed ... gets thrown regardless of include/exclude - Process memory threshold reached.
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