The update methods in AtomicReference run in a loop and may call the update function multiple time. The old values created by the update function may be discarded without cleaning up. In NettyClientStreamRpc.Connection the connect method is not side-effect-free. Although it passes a MemoizedSupplier to getAndUpdate, it still is possible that a value is supplied but then discarded in the AtomicReference loop.
-Similarly, the computeIfAbsent in ConcurrentHashMap also runs in a loop and may call the mapping function multiple times. DataStreamMap is implemented using a ConcurrentHashMap. However, the mapping function is not side-effect-free although it uses a MemoizedSupplier.-
(Update: tanxinyu pointed out that this was not a problem. Thanks! The computeIfAbsent method does not require side-effect-free as described in the javadoc; see also the comments below.)