-
Bug
-
Resolution: Unresolved
-
P3
-
8
-
None
When a ZipFile creates an Inflater to read a compressed zip entry, the Inflater is retained in a cache for future uses. Each Inflater retains around 32kb of native memory in its zlib data structures. When this cache is in heavy use, such as when iterating through a compressed zip file with many small entries, this optimization is barely positive. For its intended use of speeding up class loading, it is not really noticeable. On the other hand, for modern Java applications with many small jar files, the retained memory is a serious problem. We see classpaths on the order of 10,000 jar files, each of which has a long lived ZipFile object, resulting in memory bloat on the order of 1GB.
It's reasonable to remove the Inflater cache entirely, but it's also reasonable to have a small cache to make ZipFile iteration a wee bit faster. But native resource cleanup is always a headache.
It's reasonable to remove the Inflater cache entirely, but it's also reasonable to have a small cache to make ZipFile iteration a wee bit faster. But native resource cleanup is always a headache.
- relates to
-
JDK-7031076 InputStreams that are not closed hang around until ZipFile is closed
-
- Closed
-