Title: ManifestVersionReader leaks a ZipFile Inflater per JAR (openStream never closed) · Issue #6120 · getsentry/sentry-java · GitHub
Open Graph Title: ManifestVersionReader leaks a ZipFile Inflater per JAR (openStream never closed) · Issue #6120 · getsentry/sentry-java
X Title: ManifestVersionReader leaks a ZipFile Inflater per JAR (openStream never closed) · Issue #6120 · getsentry/sentry-java
Description: Description ManifestVersionReader.readManifestFiles() enumerates every META-INF/MANIFEST.MF on the classpath and passes URL.openStream() into new Manifest(InputStream) without closing the stream. java.util.jar.Manifest(InputStream) reads...
Open Graph Description: Description ManifestVersionReader.readManifestFiles() enumerates every META-INF/MANIFEST.MF on the classpath and passes URL.openStream() into new Manifest(InputStream) without closing the stream. j...
X Description: Description ManifestVersionReader.readManifestFiles() enumerates every META-INF/MANIFEST.MF on the classpath and passes URL.openStream() into new Manifest(InputStream) without closing the stream. j...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6120
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ManifestVersionReader leaks a ZipFile Inflater per JAR (openStream never closed)","articleBody":"## Description\n\n`ManifestVersionReader.readManifestFiles()` enumerates every `META-INF/MANIFEST.MF` on the classpath and passes `URL.openStream()` into `new Manifest(InputStream)` **without closing the stream**.\n\n`java.util.jar.Manifest(InputStream)` reads the stream and does not close it. For `jar:` URLs that stream is a `ZipFileInflaterInputStream`. Closing it is what calls `ZipFile$CleanableResource.releaseInflater()`. If it is never closed, each JAR leaves a live `java.util.zip.Inflater` (~64 KiB zlib window).\n\nThis still matches [main](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/internal/ManifestVersionReader.java) and 8.41.0 / 8.52.0.\n\n## Call site\n\n```java\nfinal Enumeration\u003cURL> resources =\n ClassLoader.getSystemClassLoader().getResources(\"META-INF/MANIFEST.MF\");\nwhile (resources.hasMoreElements()) {\n try {\n final Manifest manifest = new Manifest(resources.nextElement().openStream());\n // ...\n } catch (Exception e) {\n // ignore\n }\n}\n```\n\nTriggered from `ManifestVersionDetector.checkForMixedVersions()` → `InitUtil.shouldInit()` → `Sentry.init()`.\n\n## Observed\n\nCompose Desktop / packaged JVM app with ~80 JARs on the classpath (`sentry-java` **8.41.0**):\n\n- `GC.class_histogram`: **168** live `java.util.zip.Inflater`\n- async-profiler `event=java.util.zip.Inflater.\u003cinit>` from process start: **79 / 174** constructors (45%) are\n\n```\njava.util.zip.Inflater.\u003cinit>\njava.util.zip.ZipFile$CleanableResource.getInflater\njava.util.zip.ZipFile$ZipFileInflaterInputStream.\u003cinit>\njava.util.zip.ZipFile.getInputStream\njava.util.jar.JarFile.getBytes\njava.util.jar.JarFile.checkForSpecialAttributes\njava.util.jar.JarFile.isMultiRelease\njava.util.jar.JarFile.getEntry\nsun.net.www.protocol.jar.URLJarFile.getEntry\nsun.net.www.protocol.jar.JarURLConnection.connect\nsun.net.www.protocol.jar.JarURLConnection.getInputStream\njava.net.URL.openStream\nio.sentry.internal.ManifestVersionReader.readManifestFiles\nio.sentry.ManifestVersionDetector.checkForMixedVersions\nio.sentry.util.InitUtil.shouldInit\nio.sentry.Sentry.init\n```\n\n## Suggested fix\n\n```java\ntry (InputStream is = resources.nextElement().openStream()) {\n final Manifest manifest = new Manifest(is);\n // existing attribute handling\n} catch (Exception e) {\n // ignore\n}\n```\n\n`Manifest` does not take ownership of the stream, so try-with-resources is required even on the success path.\n","author":{"url":"https://github.com/Khang-NT","@type":"Person","name":"Khang-NT"},"datePublished":"2026-09-16T04:13:42Z","url":"https://github.com/getsentry/sentry-java/issues/6120"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ab6b11fa-8e53-604e-9d5d-1899d042cb31 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A6E4:623E7:57F4DE:7AD62C:6B0481CC |
| html-safe-nonce | 692a1e36154eae5447838d06cec146f3a5f99241485b0b7d734521e3d5ba7f68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkU0OjYyM0U3OjU3RjRERTo3QUQ2MkM6NkIwNDgxQ0MiLCJ2aXNpdG9yX2lkIjoiNDgwNTUyNzM2NDY5NDIxMzA2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c4febddb639028bc54b8182c0e2184e999242641829709197615de212f136f1e |
| hovercard-subject-tag | issue:5470136929 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6120/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9e6cf0a8b50ed81f85fdf6d5be5698990902933022998809e684c64949691507/getsentry/sentry-java/issues/6120 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9e6cf0a8b50ed81f85fdf6d5be5698990902933022998809e684c64949691507/getsentry/sentry-java/issues/6120 |
| og:image:alt | Description ManifestVersionReader.readManifestFiles() enumerates every META-INF/MANIFEST.MF on the classpath and passes URL.openStream() into new Manifest(InputStream) without closing the stream. j... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Khang-NT |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ed3f2e01f6b7672780c586c8af0e72726374d7b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width