# ResourceLeakDetector - LEAK: ReferenceCountedOpenSslContext.release() was not called before it's garbage-collected

**URL:** <https://community.gatling.io/t/resourceleakdetector-leak-referencecountedopensslcontext-release-was-not-called-before-its-garbage-collected/6533>\
**Category:** Gatling (Open-Source)\
**Created:** [March 4, 2022, 6:31am UTC](https://community.gatling.io/t/resourceleakdetector-leak-referencecountedopensslcontext-release-was-not-called-before-its-garbage-collected/6533 "2022-03-04T06:31:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jain.rdrj](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jain.rdrj](https://community.gatling.io/u/jain.rdrj)\
**Post date:** [March 4, 2022, 6:31am UTC](https://community.gatling.io/t/resourceleakdetector-leak-referencecountedopensslcontext-release-was-not-called-before-its-garbage-collected/6533/1 "2022-03-04T06:31:08Z")

</div>

Facing memory leak on execution. We are using gatling 3.4.1 and using 3 injectors for load simulation. We are able to run the simulation with 1/6th of load but its failing while increasing the load. Any idea how to fix this issue?  
Logs:-  
2022-03-03 13:50:39,255 [ERROR] i.n.u.ResourceLeakDetector - LEAK: ReferenceCountedOpenSslContext.release() was not called before it’s garbage-collected. See [Netty.docs: Reference counted objects](https://netty.io/wiki/reference-counted-objects.html) for more information.  
Recent access records:  
Created at:  
io.netty.handler.ssl.ReferenceCountedOpenSslContext.(ReferenceCountedOpenSslContext.java:240)  
io.netty.handler.ssl.ReferenceCountedOpenSslClientContext.(ReferenceCountedOpenSslClientContext.java:67)  
io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:836)  
io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:611)  
io.gatling.http.util.SslContextsFactory.newSslContexts(SslContexts.scala:120)  
io.gatling.http.engine.HttpEngine.newSslContexts(HttpEngine.scala:195)  
io.gatling.http.cache.SslContextSupport$.$anonfun$setSslContexts$1(SslContextSupport.scala:54)  
scala.Function1.$anonfun$andThen$1(Function1.scala:57)  
scala.Function1.$anonfun$andThen$1(Function1.scala:57)  
scala.Function1.$anonfun$andThen$1(Function1.scala:57)  
scala.Function1.$anonfun$andThen$1(Function1.scala:57)  
scala.Function1.$anonfun$andThen$1(Function1.scala:57)  
io.gatling.core.controller.inject.Workload.startUser(Workload.scala:53)  
io.gatling.core.controller.inject.Workload.$anonfun$injectUser$1(Workload.scala:66)  
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)  
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)  
io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384)  
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)  
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)  
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)  
java.lang.Thread.run(Thread.java:748)

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [March 4, 2022, 7:40am UTC](https://community.gatling.io/t/resourceleakdetector-leak-referencecountedopensslcontext-release-was-not-called-before-its-garbage-collected/6533/2 "2022-03-04T07:40:24Z")

</div>

Hi,

You’re using Gatling 3.4.1, which was released in October, 2020. It’s very old. As of now, the current release is 3.7.6.

Please first upgrade and if you still experience an issue, please provide a [reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).

Cheers

---

<div class="post-metadata">

**Author:** ![jain.rdrj](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jain.rdrj](https://community.gatling.io/u/jain.rdrj)\
**Post date:** [March 4, 2022, 12:11pm UTC](https://community.gatling.io/t/resourceleakdetector-leak-referencecountedopensslcontext-release-was-not-called-before-its-garbage-collected/6533/3 "2022-03-04T12:11:52Z")

</div>

Sorry we are using gatling version 3.6.1

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [March 4, 2022, 1:15pm UTC](https://community.gatling.io/t/resourceleakdetector-leak-referencecountedopensslcontext-release-was-not-called-before-its-garbage-collected/6533/4 "2022-03-04T13:15:01Z")

</div>

Still, that’s not 3.7.6 🙂 Please upgrade. Then, if you still experience an issue, please provide a reproducer as requested above.
