JinwooHwang commented on PR #8075: URL: https://github.com/apache/geode/pull/8075#issuecomment-5653325402
Thanks for the review, @sboorlagadda. Added FileOutputStreamJUnitTest.testSmallFileAllocatesLessThanChunkSize, which measures thread allocation while writing a 100-byte file. It fails against develop's FileOutputStream (1,055,576 bytes allocated) and passes on this branch. Base/head allocation per stream in bytes (JDK 17, ThreadMXBean, best of 7, 1000-byte writes, open through close): ``` Written develop GEODE-10646 1,000 B 1,055,896 15,480 64 KiB 1,120,432 194,920 512 KiB 1,579,184 1,571,392 1 MiB 2,103,472 3,144,328 5 MiB 6,322,864 7,363,784 ``` This is consistent with your numbers: outputs reaching 1 MiB allocate about 1 MiB more per stream, from buffer growth. This PR isn't intended to address the integration-test OOM. To verify the effect with many streams open at once, I opened 452 streams on a map-backed FileSystem and wrote 2 KiB to each, using a 768 MiB heap. On develop each stream reserves a full 1 MiB buffer at open, and the 452 streams did not fit in the heap. On this branch the same streams retained about 6 MB. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
