Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

PropertiesProvider resource (and native memory) leaking #337

@dargiri

Description

@dargiri

Dear Google team,

During our internal performance testing we found out that there's a resource leak (which is causing abnormal native memory consumption) in com.google.api.gax.core.PropertiesProvider class. Test app with google datastore api consumed more than 20 GB of RAM and java process got killed by linux's OOM killer.

Methods

PropertiesProvider#loadProperty(Class<?> loadedClass, String propertiesPath, String key)
and
PropertiesProvider#loadProperty(Properties properties, String propertiesPath, String key)

are loading resources but not closing them(input stream is not closed). So native resources are held using java.util.zip.Inflater (See java.util.zip.GZIPInputStream).

Another proposal is to cache results of property loading by key. Even dumb implementation with synchronization of entire method and HashMap(as cache provider) will work quicker than loading of resource each time.

Tested on linux with latest JDK 8.

BR,
Dionis

Metadata

Metadata

Labels

🚨This issue needs some love.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions