René's URL Explorer Experiment


Title: Root Allocator doesn't release memory when its closed · Issue #950 · apache/arrow-java · GitHub

Open Graph Title: Root Allocator doesn't release memory when its closed · Issue #950 · apache/arrow-java

X Title: Root Allocator doesn't release memory when its closed · Issue #950 · apache/arrow-java

Description: Describe the bug, including details regarding any error messages, version, and platform. There is a bug in the root allocator where it doesn't release the memory when it's closed. Attached the sample code that prints the RSS memory. I ra...

Open Graph Description: Describe the bug, including details regarding any error messages, version, and platform. There is a bug in the root allocator where it doesn't release the memory when it's closed. Attached the samp...

X Description: Describe the bug, including details regarding any error messages, version, and platform. There is a bug in the root allocator where it doesn't release the memory when it's closed. Attached ...

Opengraph URL: https://github.com/apache/arrow-java/issues/950

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Root Allocator doesn't release memory when its closed","articleBody":"### Describe the bug, including details regarding any error messages, version, and platform.\n\nThere is a bug in the root allocator where it doesn't release the memory when it's closed. Attached the sample code that prints the RSS memory. \n\nI ran this code with the following jvm params\n```\n--add-opens=java.base/java.nio=ALL-UNNAMED -Xms1g -Xmx1g -XX:+AlwaysPreTouch\n```\n\nCode\n```\npublic final class ArrowOnlyParquetMemoryRepro {\n\n  private static final long ARROW_MEMORY_LIMIT_BYTES = 100L * 1024L * 1024L; // 100 MB\n  private static final int ARROW_BATCH_SIZE_ROWS = 1024 * 1024; // 1 million rows\n\n  private ArrowOnlyParquetMemoryRepro() {\n  }\n\n  public static void main(String[] args) throws Exception {\n    // Parse arguments\n    File parquetFile = null;\n    List\u003cString\u003e scanCols = null;\n\n    for (int i = 0; i \u003c args.length; i++) {\n      if (\"--path\".equals(args[i]) \u0026\u0026 i + 1 \u003c args.length) {\n        parquetFile = new File(args[i + 1]);\n      } else if (\"--scanCols\".equals(args[i]) \u0026\u0026 i + 1 \u003c args.length) {\n        scanCols = parseCsv(args[i + 1]);\n      }\n    }\n\n    if (parquetFile == null || scanCols == null || scanCols.isEmpty()) {\n      System.err.println(\"Usage: ArrowOnlyParquetMemoryRepro --path \u003cfile.parquet\u003e --scanCols \u003ccol1,col2,...\u003e\");\n      System.exit(1);\n    }\n\n    if (!parquetFile.exists() || !parquetFile.isFile()) {\n      System.err.println(\"File does not exist: \" + parquetFile.getAbsolutePath());\n      System.exit(1);\n    }\n\n    log(\"config\", \"file=\" + parquetFile.getAbsolutePath() + \" cols=\" + scanCols);\n    logRss(\"start\");\n\n    // Scan each column\n    for (String col : scanCols) {\n      logRss(\"before_scan:\" + col);\n      scanColumn(parquetFile, col);\n      logRss(\"after_scan:\" + col);\n    }\n\n    logRss(\"end\");\n\n    // Force GC and observe RSS\n    System.gc();\n    Thread.sleep(1000);\n    logRss(\"after_gc\");\n\n    // Keep process alive for external memory inspection (e.g., via `ps` or `/proc/\u003cpid\u003e/status`)\n    log(\"info\", \"Process will now sleep. Use 'ps -o rss,pid,command' or 'cat /proc/\u003cpid\u003e/status' to inspect RSS.\");\n    while (true) {\n      Thread.sleep(60_000);\n      System.gc();\n      logRss(\"sleeping\");\n    }\n  }\n\n  private static void scanColumn(File parquetFile, String col) throws Exception {\n    long rowsScanned = 0;\n\n    try (RootAllocator allocator = new RootAllocator(ARROW_MEMORY_LIMIT_BYTES);\n        DatasetFactory datasetFactory = new FileSystemDatasetFactory(\n            allocator, NativeMemoryPool.getDefault(), FileFormat.PARQUET, parquetFile.toURI().toString());\n        Dataset dataset = datasetFactory.finish()) {\n\n      ScanOptions options = new ScanOptions.Builder(ARROW_BATCH_SIZE_ROWS)\n          .columns(Optional.of(new String[]{col}))\n          .build();\n\n      try (Scanner scanner = dataset.newScan(options);\n          ArrowReader reader = scanner.scanBatches()) {\n        while (reader.loadNextBatch()) {\n          VectorSchemaRoot root = reader.getVectorSchemaRoot();\n          if (root == null || root.getFieldVectors().isEmpty()) {\n            continue;\n          }\n          FieldVector vector = root.getVector(col);\n          if (vector == null) {\n            log(\"warn\", \"Column not found in file: \" + col);\n            return;\n          }\n          int rowCount = root.getRowCount();\n          // Access values to ensure they're materialized\n          for (int i = 0; i \u003c rowCount; i++) {\n            vector.getObject(i);\n          }\n          rowsScanned += rowCount;\n        }\n      }\n    }\n\n    log(\"scan\", \"col=\" + col + \" rowsScanned=\" + rowsScanned);\n  }\n\n  private static List\u003cString\u003e parseCsv(String csv) {\n    List\u003cString\u003e result = new ArrayList\u003c\u003e();\n    for (String part : csv.split(\",\")) {\n      String trimmed = part.trim();\n      if (!trimmed.isEmpty()) {\n        result.add(trimmed);\n      }\n    }\n    return result;\n  }\n\n  private static void logRss(String phase) {\n    long rssKb = readRssKb();\n    if (rssKb \u003c 0) {\n      log(\"rss\", \"phase=\" + phase + \" rssKb=N/A (not on Linux)\");\n    } else {\n      log(\"rss\", \"phase=\" + phase + \" rssKb=\" + rssKb + \" rssMb=\" + (rssKb / 1024));\n    }\n  }\n\n  private static long readRssKb() {\n    File status = new File(\"/proc/self/status\");\n    if (!status.exists()) {\n      return -1;\n    }\n    try (BufferedReader br = new BufferedReader(new FileReader(status, StandardCharsets.UTF_8))) {\n      String line;\n      while ((line = br.readLine()) != null) {\n        if (line.startsWith(\"VmRSS:\")) {\n          String[] parts = line.trim().split(\"\\\\s+\");\n          if (parts.length \u003e= 2) {\n            return Long.parseLong(parts[1]);\n          }\n        }\n      }\n      return -1;\n    } catch (Exception e) {\n      return -1;\n    }\n  }\n\n  private static void log(String tag, String msg) {\n    System.out.println(\"[\" + tag + \"] \" + msg);\n  }\n}\n```\n\nThis is the output\n```\n[rss] phase=start rssKb=1121340 rssMb=1095\n[rss] phase=before_scan:col_name rssKb=1121808 rssMb=1095\n2026-01-08T10:58:01,040 INFO  [main] org.apache.arrow.memory.BaseAllocator - Debug mode disabled. Enable with the VM option -Darrow.memory.debug.allocator=true.\n2026-01-08T10:58:01,049 INFO  [main] org.apache.arrow.memory.DefaultAllocationManagerOption - allocation manager type not specified, using netty as the default type\n2026-01-08T10:58:01,076 INFO  [main] org.apache.arrow.memory.CheckAllocator - Using DefaultAllocationManager at \u003cclass name\u003e\n[scan] col=col_name rowsScanned=2734751\n[rss] phase=after_scan:col_name rssKb=1313364 rssMb=1282\n[rss] phase=before_scan:col_name rssKb=1313364 rssMb=1282\n[scan] col=col_name rowsScanned=2734751\n[rss] phase=after_scan:col_name rssKb=1331144 rssMb=1299\n[rss] phase=before_scan:col_name rssKb=1331144 rssMb=1299\n[scan] col=col_name rowsScanned=2734751\n[rss] phase=after_scan:col_name rssKb=1338228 rssMb=1306\n[rss] phase=end rssKb=1338228 rssMb=1306\n[rss] phase=after_gc rssKb=1338228 rssMb=1306\n[info] Process will now sleep. Use 'ps -o rss,pid,command' or 'cat /proc/\u003cpid\u003e/status' to inspect RSS.\n[rss] phase=sleeping rssKb=1338228 rssMb=1306\n```","author":{"url":"https://github.com/krishan1390","@type":"Person","name":"krishan1390"},"datePublished":"2026-01-08T11:02:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/950/arrow-java/issues/950"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f3823bf5-676b-fa9a-e8d2-1eb54b4edbb6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD01E:804D0:190339F:20161DE:6991B4CF
html-safe-nonce9d00b183db3bc6b002b8abe187c54f4eafa55015a8d9892ec0f6e99c8b1f5f18
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDFFOjgwNEQwOjE5MDMzOUY6MjAxNjFERTo2OTkxQjRDRiIsInZpc2l0b3JfaWQiOiIxNzc2ODQ1MjU5MzY5NzIzMDg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac443050713337692fcb1103607a10d876ccb36a490b60e646c80097659ef26264
hovercard-subject-tagissue:3792417426
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/arrow-java/950/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4bc6c2983d12357d9d964e3f33d0cb8bb3e4b3a12e3176e5f37c1c4ca07477e7/apache/arrow-java/issues/950
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4bc6c2983d12357d9d964e3f33d0cb8bb3e4b3a12e3176e5f37c1c4ca07477e7/apache/arrow-java/issues/950
og:image:altDescribe the bug, including details regarding any error messages, version, and platform. There is a bug in the root allocator where it doesn't release the memory when it's closed. Attached the samp...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekrishan1390
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/apache/arrow-java git https://github.com/apache/arrow-java.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id893682219
octolytics-dimension-repository_nwoapache/arrow-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id893682219
octolytics-dimension-repository_network_root_nwoapache/arrow-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release848bc6032dcc93a9a7301dcc3f379a72ba13b96e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/arrow-java/issues/950#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Farrow-java%2Fissues%2F950
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Farrow-java%2Fissues%2F950
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=apache%2Farrow-java
Reloadhttps://github.com/apache/arrow-java/issues/950
Reloadhttps://github.com/apache/arrow-java/issues/950
Reloadhttps://github.com/apache/arrow-java/issues/950
apache https://github.com/apache
arrow-javahttps://github.com/apache/arrow-java
Notifications https://github.com/login?return_to=%2Fapache%2Farrow-java
Fork 111 https://github.com/login?return_to=%2Fapache%2Farrow-java
Star 83 https://github.com/login?return_to=%2Fapache%2Farrow-java
Code https://github.com/apache/arrow-java
Issues 403 https://github.com/apache/arrow-java/issues
Pull requests 38 https://github.com/apache/arrow-java/pulls
Discussions https://github.com/apache/arrow-java/discussions
Actions https://github.com/apache/arrow-java/actions
Security 0 https://github.com/apache/arrow-java/security
Insights https://github.com/apache/arrow-java/pulse
Code https://github.com/apache/arrow-java
Issues https://github.com/apache/arrow-java/issues
Pull requests https://github.com/apache/arrow-java/pulls
Discussions https://github.com/apache/arrow-java/discussions
Actions https://github.com/apache/arrow-java/actions
Security https://github.com/apache/arrow-java/security
Insights https://github.com/apache/arrow-java/pulse
New issuehttps://github.com/login?return_to=https://github.com/apache/arrow-java/issues/950
New issuehttps://github.com/login?return_to=https://github.com/apache/arrow-java/issues/950
Root Allocator doesn't release memory when its closedhttps://github.com/apache/arrow-java/issues/950#top
Type: bugSomething isn't workinghttps://github.com/apache/arrow-java/issues?q=state%3Aopen%20label%3A%22Type%3A%20bug%22
https://github.com/krishan1390
https://github.com/krishan1390
krishan1390https://github.com/krishan1390
on Jan 8, 2026https://github.com/apache/arrow-java/issues/950#issue-3792417426
Type: bugSomething isn't workinghttps://github.com/apache/arrow-java/issues?q=state%3Aopen%20label%3A%22Type%3A%20bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.