)]}'
{
  "commit": "85d7ef30ee5f623cf3442dd989df09c3c5754ad2",
  "tree": "6bc52d6d14c1618a5f7257241d58a85c02bea47a",
  "parents": [
    "06170242bde2f492e068235efdd2183a3cbd87d7"
  ],
  "author": {
    "name": "Sandesh Kumar",
    "email": "sandeshkr419@gmail.com",
    "time": "Thu Aug 06 17:29:51 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Aug 07 09:29:51 2026 +0900"
  },
  "message": "GH-1239: Fix memory leak when C Data import hits allocator limit mid-array (#1240)\n\n`ReferenceCountedArrowArray.unsafeAssociateAllocation` calls `retain()`\nbefore `wrapForeignAllocation`. If `wrapForeignAllocation` throws\n(allocator over its limit), the retain is never balanced, the reference\ncount stays elevated, and the C Data release callback never fires —\nleaking the producer\u0027s native memory.\n\n**Fix:** call `retain()` after `wrapForeignAllocation` returns. Same\nbehavior on the success path; on failure the existing `finally` in\n`ArrayImporter.importArray` drives the count to zero and fires the\nrelease callback.\n\n**Test:** `ImportOutOfMemoryTest` — exports a batch from a \"producer\"\nallocator, tries to import it into a too-small consumer, and asserts the\nproducer drains to zero after the OOM. Fails on the original code,\npasses with the fix.\n\nFixes: https://github.com/apache/arrow-java/issues/1239\n\n---------\n\nSigned-off-by: Sandesh Kumar \u003ckusandes@amazon.com\u003e\nCo-authored-by: Sandesh Kumar \u003ckusandes@amazon.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cf50f9417b6021b173015d46d1ec3196a8088606",
      "old_mode": 33188,
      "old_path": "c/src/main/java/org/apache/arrow/c/ReferenceCountedArrowArray.java",
      "new_id": "f51fb2510557f891adbe3045e24a4c66c5b83786",
      "new_mode": 33188,
      "new_path": "c/src/main/java/org/apache/arrow/c/ReferenceCountedArrowArray.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7c099f2ef09e6b9d3b9e9ef6955080073177cefe",
      "new_mode": 33188,
      "new_path": "c/src/test/java/org/apache/arrow/c/ImportOutOfMemoryTest.java"
    }
  ]
}
