Closed Natalia588 closed 11 minutes ago
Most likely the classloader leak is related to https://github.com/statsig-io/ip3country-kotlin/blob/d74b35b52de8d26997c783eded96b702ca75a625/src/main/kotlin/CountryLookup.kt#L17
In our service we are using the UnitID criteria, so we do not need IP lookup (ConfigCondition.IP_BASED) at all. How can we set the ConfigCondition.UNIT_ID to the StatsigUser object to avoid calls to CountryLookup for every statsig check?
We've been debugging a memory leak in the java server sdk so this is very timely. We're continuing to look today.
In terms of your gate, can you link to it? I agree that it shouldnt be hitting the ip lookup if its just an id check. Is it possible any gate in your project hits this?
Does your service or webserver shutdown/restart, and is that when you are observing the leak? Or is it while you are running the service for an extended period of time?
Our service uses only the feature gates with UnitID criteria (based on tenantID).
Memory usage constantly increases during the service run, unrelated to service shutdown/restart.
We havent been able to reproduce this - do you have any more details for how you got this? When did you capture this snapshot? What sort of QPS did you have for gate checks while the server was running?
Hi @Natalia588 Please check out our newest release, https://github.com/statsig-io/java-server-sdk/releases/tag/1.21.0 We've provided a new statsigOption to disable ip3 country library.
Let me know if after disabling ip3 country library the pod's memory usage is still increasing
Thank you. We will test the new version and let you know about the results.
@Natalia588 Thanks, Is it getting better now?
Thanks @weihao-statsig Seems like it's better now, but I would like to check it on distance. At least I don't see Country Lockup in heap dumps anymore.
We will keep you updated!
Hello,
We've recently enabled the statsig in our microservice. And we see that our pod's memory usage is constantly increasing. We've updated the statsig SDK to the latest version, but still the same. It appears to be a classloader leak and is probably related to the ip3country.CountryLookup:
Could you please share your opinion about it? Why can it happen?
Our service performs statsig checks very often. And for every check we create a new StatsigUser with the appropriate tenantId - our feature gates perform checks based on the tenant. Maybe, it's better to store the StatsigUser instance and reuse it instead of instantiation for every statsig call. What would you recommend?