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.

Off-heap memory leak in Spark < 2.1: PoolThreadCaches aren't getting freed?

See original GitHub issue

Expected behavior

PoolThreadCache should be freed when thread it is bound to terminates.

Actual behavior

We observed off-heap memory leak in our application that is run in Spark 1.6.2 on Amazon EMR 4.8.0. Analyzing driver’s heap dump I noticed that PoolThreadLocalCache’s caches counter doesn’t decrease which makes me thinking that PoolThreadCache is not getting freed: image At the same time there are not that many threads: image

Steps to reproduce

I don’t think it is specific to our application but rather to Spark/Netty itself.

Minimal yet complete reproducer code (or URL to code)

I can provide heap dumps if needed.

Netty version

4.0.29.Final

JVM version (e.g. java -version)

java version “1.8.0_45” Java™ SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot™ 64-Bit Server VM (build 25.45-b02, mixed mode)

OS version (e.g. uname -a)

Amazon (emr-4.8.0), Linux 4.4.11-23.53.amzn1.x86_64 #1 SMP Wed Jun 1 22:22:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Jun 6, 2017

Then maybe you should create an issue in spark ?

On 6. June 2017 at 20:28:25, Yauheni Audzeichyk (notifications@github.com) wrote:

@Scottmitch https://github.com/scottmitch unfortunately, I can not upgrade to a newer version of Netty as Spark on EMR comes bundled with it. Also that property is not available in 4.0.29.Final.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/netty/netty/issues/6819#issuecomment-306575848, or mute the thread https://github.com/notifications/unsubscribe-auth/AAa0QgUoNu8bbvpg1aiPGpRLwev-mwvIks5sBZpJgaJpZM4NxPV3 .

0reactions
Scottmitchcommented, Jun 8, 2017

@yaud - great thanks for closing the loop!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apache Spark and off-heap memory on waitingforcode.com
Off -heap memory is used in Apache Spark for the storage and for the execution data. The former use concerns caching.
Read more >
Spark off heap memory expanding with caching - Stack Overflow
Spark may use off-heap memory during shuffle and cache block transfers; even if spark.memory.offHeap.use=false .
Read more >
A step-by-step guide for debugging memory leaks in Spark ...
Step 1: Check Driver logs. What's causing the problem? · Step 2: Check Executor Logs. Why are they failing? · Step 3: Check...
Read more >
subject:"Memory" - The Mail Archive
I notice a change about the memory module of yarn container between spark-2.3.0 and spark-3.2.1 when requesting containers from yarn. org.
Read more >
Memory management and patterns in ASP.NET Core
Frequent memory allocation/free cycles can fragment memory, especially when allocating large chunks of memory. Objects are allocated in ...
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