On Thu, 9 Jul 2026 18:32:31 GMT, Andy Goryachev <[email protected]> wrote:
>> John Hendrikx has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix flakey check on (asynchronous) stderr output > > modules/javafx.base/src/main/java/com/sun/javafx/binding/ArrayManager.java > line 347: > >> 345: * When the minimum size of the array is 3 (MINIMUM_SIZE), >> 346: * then the resizing algorithm used here always uses specific >> 347: * sizes: 3, 7, 13, 22, 36, etc... > > question: wouldn't it use more memory than necessary if the underlying memory > allocation uses power of two blocks? wouldn't it make more sense to use > power of two sized blocks? This mirrors roughly how `ArrayList` does this (it also increases by about 50% each time) instead of doubling (this has an overhead of about 25% per element on average, while doubling would have one of about 50% on average). The underlying allocation for the array memory may do alignment rounding, but it is not forcing power of two sizes. The reason the resizing algorithm is super deterministic is because we also shrink the arrays when there is no need for the space anymore (but we want to avoid a shrink->grow->shrink scenario on boundaries, so there is some overlap here). ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1081#discussion_r3558581670
