A long standing complaint is that using the Selector API can involve a lot of short lived objects and GC.
JDK-8199433 added new APIs in Java SE 11 to invoke an action with the selected keys rather than adding it to the selected-key set and that eliminated most of the issue for code that migrates to the newer API. One remaining issue is the cancelled key set. When a key is cancelled it is added to this set for the next selection operation. The cancelled key set is not accessible (except to custom Selector implementations) so there is scope to replace this usage.