RFR: 8330077: Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT [v2]

Fabian Meumertzheim duke at openjdk.org
Fri Apr 12 07:38:57 UTC 2024


On Thu, 11 Apr 2024 22:00:37 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> It you are reacting to the OVERFLOW events already, I doubt we need to get to Integer.MAX_VALUE. Maybe all that's needed is something large enough to reduce the frequency of OVERFLOW events. I don't have any insight into that.

I searched for usage reports and found users trying to watch "billions" of files at a time. Given that the actual limit is still user-configurable and the default remains at 512, I'm not sure whether there is any reasonable hard limit I could come up with that doesn't unnecessarily restrict users. After all, *if* a user sets this limit so high that they run into e.g. memory issues due to a large event list, wouldn't we consider them responsible for this?

In lieu of an actual upper bound I could justify, I went with `ArraySupport.SOFT_MAX_ARRAY_LENGTH` for now so that an OVERFLOW event is likely to. be sent before the list OOMs when trying to grow.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18739#discussion_r1562153021


More information about the nio-dev mailing list