RFR: 8286597: Implement PollerProvider on AIX [v9]

Martin Doerr mdoerr at openjdk.org
Fri May 19 15:37:02 UTC 2023


On Fri, 19 May 2023 15:00:09 GMT, Tyler Steele <tsteele at openjdk.org> wrote:

>> If you look at the Poller implementations on the other platform you'll see that they allocate the poll array at construction time, I think that is what you want here too.
>
> You are correct that there is a malloc/free per poll. I made this decision intentionally.
> 
> The other implementations allocate a fixed size array at object creation. This imposes an upper limit on the number of fds that can be polled. I made the decision to move this allocation to the poll call and track the size of the poll set. This way, (1) the only limit to the size of the poll set is the system limit on number of open fds (if you can open an fd it can be polled) (2) there is no wasted space to an arbitrarily large array when there are only a few fds polled.

You must be very positive about the AIX implementation of malloc/free. :-)
malloc/free may:
- be slower than desired
- cause fragmentation
- not return some of the freed memory to the OS

I don't know how well it is on AIX. So, I agree with Alan. That should better get checked.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13452#discussion_r1199100351


More information about the hotspot-dev mailing list