RFR: Enhancements for Shenandoah's generational mode [v6]

Aleksey Shipilev shade at openjdk.org
Fri Mar 31 07:55:46 UTC 2023


On Thu, 30 Mar 2023 22:10:13 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> src/main/java/org/openjdk/shenandoah/CircularBuffer.java line 79:
>> 
>>> 77: 
>>> 78:     public int size() {
>>> 79:         return Math.min(count, elements.length);
>> 
>> Why not just `return count`?
>
> The code uses `count` to detect when the write index has wrapped (count itself does not wrap). This is mostly to support counted loop iteration.

All right then!

>> src/main/java/org/openjdk/shenandoah/DataConnector.java line 104:
>> 
>>> 102:                     subscribeToGarbageCollectorNotifications(server);
>>> 103:                     monitoredVmConsumer.accept(vm);
>>> 104:                     shouldRun = false;
>> 
>> `shouldRun` looks redundant,  can just `break` out of the `while(true)` loop here.
>
> `shouldRun` can be changed by other threads (for example, when a recording is loaded we stop looking for monitored VMs).

All right, this would be a target for clean up later.

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

PR Review Comment: https://git.openjdk.org/shenandoah-visualizer/pull/1#discussion_r1154139229
PR Review Comment: https://git.openjdk.org/shenandoah-visualizer/pull/1#discussion_r1154139721


More information about the shenandoah-dev mailing list