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.

Memory Leak when I try to create client

See original GitHub issue

Expected behavior

It should’t have memory leak.

Actual behavior

[main] ERROR io.netty.util.ResourceLeakDetector  - LEAK: HashedWheelTimer.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.
Recent access records: 
Created at:
	io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:272)
	io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:216)
	io.netty.util.HashedWheelTimer.<init>(HashedWheelTimer.java:195)
	org.redisson.connection.MasterSlaveConnectionManager.initTimer(MasterSlaveConnectionManager.java:318)
	org.redisson.connection.MasterSlaveConnectionManager.<init>(MasterSlaveConnectionManager.java:161)
	org.redisson.connection.SingleConnectionManager.<init>(SingleConnectionManager.java:34)
	org.redisson.config.ConfigSupport.createConnectionManager(ConfigSupport.java:192)
	org.redisson.Redisson.<init>(Redisson.java:122)
	org.redisson.Redisson.create(Redisson.java:159)
	test.main(test.java:32)

Steps to reproduce or test case

        Codec stringCodec = new StringCodec();

        for (int i = 0; i < 10; i++) {
            RedissonClient client;
            Config config = new Config();
            config.useSingleServer().setAddress(RedisConfig.Address);
            config.useSingleServer().setPassword(RedisConfig.Password);
            config.setCodec(stringCodec);
            client = Redisson.create(config);

            BatchOptions options = BatchOptions.defaults();
            RBatch pipe = client.createBatch(options);

            pipe.getBucket("test", stringCodec).getAsync();
            BatchResult res = pipe.execute();

            System.out.println(res.getResponses().get(0));

            client.shutdown();

            System.gc();
        }

Redis version

4.0.10

Redisson version

3.7.5

Redisson configuration

Config config = new Config();
config.useSingleServer().setAddress(RedisConfig.Address);
config.useSingleServer().setPassword(RedisConfig.Password);
config.setCodec(stringCodec);
client = Redisson.create(config);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
mrnikocommented, Aug 29, 2018

Fixed! Thanks for report

1reaction
mrnikocommented, Sep 6, 2018

3.8.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redisson memory leak When I try to create client
This looks like a bug in Redisson where it creates a lot of HashedWheelTimer without closing these. I would open a bug-report there....
Read more >
Fixing memory leaks in web applications | Read the Tea Leaves
But it's extremely unlikely to leak memory on the client side, since the browser will clear the memory every time you navigate between...
Read more >
Causes of Memory Leaks in JavaScript and How to Avoid Them
In this article, we will explore programming patterns that cause memory leaks in JavaScript and explain how to improve memory management.
Read more >
4 Types of Memory Leaks in JavaScript and How to Get Rid Of ...
In this article we will explore common types of memory leaks in client-side JavaScript code. We will also learn how to use the...
Read more >
Understanding Memory Leaks in Java - Baeldung
A Memory Leak is a situation where there are objects present in the heap that are no longer used, but the garbage collector...
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