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.

Possible memory leak in Tasks.scala

See original GitHub issue

I have a relatively large multimodule project (30+modules) which, thanks to hadoop, transitively depends on about half of maven-central.

When I perform project-wise operations like sbt update (or hitting Refresh Project in intelliJ), the JVM ends up in OutOfMemoryError (GC overhead limit exceeded). The same operation with coursier plugin disabled works fine (as long as wasting 10+ minutes can be considered as fine 😃 ).

Upon heap dump investigation (which is definitely not one of my strongest skills), it appears that the heap contains millions (40+) of HashMap entries, many of whose nearest GC-root seems to be the reportsCache created here.

The version used is 1.0.0-M14-9

Illustration : http://imgur.com/a/PS37A

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
vil1commented, May 13, 2017

I confirm, the memory problems seem to be fixed by #462 Thx a lot

1reaction
vil1commented, Nov 25, 2016

I finally managed to work around the problem using the following JVM options for SBT :

-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
-XX:ParallelGCThreads=4
-XX:ConcGCThreads=4
-XX:InitiatingHeapOccupancyPercent=50

(Thanks to @samklr’s advice)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory leak in Scala and processes - java - Stack Overflow
First capture a heap dump when your application crashes due to an out of memory issue. Add the following flags when starting the...
Read more >
Out of Memory Error (Possible Memory Leak in Scala?) #508
It looks like your application ran out of memory a few times last night, which may be a contributing factor. [0] We can...
Read more >
Memory Leak In Scala And Processes - ADocLib
Memory leaks block access to resources and cause an application to consume more memory over time leading to degrading system performance. If. The...
Read more >
Memory leaks in Scala Future ? : r/scala - Reddit
He talks about ScalaZ Task. At 7:15 - 7:40 he says that Futures can leak memory. Is it true and can anyone explain...
Read more >
A step-by-step guide for debugging memory leaks in Spark ...
If a task fails more than four (4) times (if spark.task. ... What this essentially means is that enough memory must be available...
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