Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak exception #4

Closed
mkj-git opened this issue May 22, 2014 · 13 comments · Fixed by #5
Closed

Memory leak exception #4

mkj-git opened this issue May 22, 2014 · 13 comments · Fixed by #5

Comments

@mkj-git
Copy link

mkj-git commented May 22, 2014

I am running a web application in tomcat. I am using geoip2 0.7.1 java driver version. It throws

SEVERE: The web application [/anant] created a ThreadLocal with key of type
[com.maxmind.db.ThreadBuffer](value [com.maxmind.db.ThreadBuffer@8a64bb2]) and a value
of type [java.nio.DirectByteBufferR](value [java.nio.DirectByteBufferR[pos=12545442
lim=28655468 cap=28655468]]) but failed to remove it when the web application was
stopped. Threads are going to be renewed over time to try and avoid a probable memory

refer :

http://stackoverflow.com/questions/23801992/memory-leak-metrics-meter-tick-thread-and-new-i-o-client-worker

leak.

@oschwald
Copy link
Member

Thanks for reporting this. Could you provide a bit more information on how you are using the database? Are you sharing one opened database with many threads or are you opening the database many times? Are you closing the database? When do you get this error?

@mkj-git
Copy link
Author

mkj-git commented May 22, 2014

    File database = new File(geoLiteDbPath);
    try {
        reader = new DatabaseReader.Builder(database).build();
    } catch (IOException ex) {}

This code is called at the starting of application only once and then i use below code to get it

public DatabaseReader getGeoLiteDbReader(){if(reader==null) initGeoLite2(); return reader;}

When i terminate my application then it show above memory leak message

@mkj-git
Copy link
Author

mkj-git commented May 22, 2014

I using
if(reader!=null) reader.close();
to close it

@oschwald
Copy link
Member

Thanks. We will look into this.

@oschwald
Copy link
Member

I just published 0.3.3-SNAPSHOT to Maven Central that should fix this. If you have a chance, would you be able to test this to see if the warning goes away?

@mkj-git
Copy link
Author

mkj-git commented May 24, 2014

@oschwald
Copy link
Member

You are reporting an issue with the MaxMind DB reader, which GeoIP2 uses but is separate from GeoIP2. As I mentioned, I created a 0.3.3-SNAPSHOT release of the maxmind-db artifact. If it is not available from your Maven mirror, you make download it from oss.sonatype.org.

@mkj-git
Copy link
Author

mkj-git commented May 28, 2014

given link doesn't show more than 'Loading Nexsus ui...` meassage

@oschwald
Copy link
Member

Here is a direct link to the JAR. It should be on any snapshot mirror of Sonatype doesn't work for you.

@borisz borisz closed this as completed in #5 May 29, 2014
@mkj-git
Copy link
Author

mkj-git commented Jun 2, 2014

I dont understand one thing that when i am using GeoIp2, the only jar i am using is

com.maxmind.geoip2 geoip2 0.7.1

and its handling reader no other jars I am using so what is the purpose of jar that you have given?

@oschwald
Copy link
Member

oschwald commented Jun 2, 2014

The maxminddb JAR is a dependency of the geoip2 JAR.

@mkj-git
Copy link
Author

mkj-git commented Jun 2, 2014

shall i include it in my project POM.xml with geoip2-0.7.1.jar. ?

@oschwald
Copy link
Member

oschwald commented Jun 2, 2014

I did a 0.7.2 release of geoip2 that requires the new version of maxmind-db an hour or two ago. You can just use that directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants