RFR: 7002: Too large graphs will freeze JMC

Marcus Hirt hirt at openjdk.java.net
Tue Jan 12 11:35:04 UTC 2021


On Sun, 10 Jan 2021 18:17:42 GMT, Alex Ciminian <github.com+348973+cimi at openjdk.org> wrote:

> This PR adds a control to limit the maximum number of nodes that can be rendered in the JMC graph view.
> 
> At the moment, rendering very large graphs makes the application unresponsive so we want to guard against this by setting a limit on the maximum number of nodes that will be rendered. When this limit is exceeded, we don't try to render our `StacktraceGraphModel` into a graphiz dot string and instead we generate a simple dot string with one node and a message informing the user that they are trying to render too many nodes.
> 
> I spent a couple of hours fighting with SWT to get the basic dropdown functionality working in the component toolbar. I took some inspiration from the FlameView component's toolbar actions and I found some (not great) examples with Google. I'm happy to use other components - this seemed to be the simplest from what I found. Please let me know if there's anything better. ��
> 
> ---
> 
> ![Screenshot 2021-01-10 at 18 14 39](https://user-images.githubusercontent.com/348973/104131749-4987a100-5370-11eb-8ae1-b9ee8064921f.png)
> 
> ![Screenshot 2021-01-10 at 18 15 00](https://user-images.githubusercontent.com/348973/104131756-5c01da80-5370-11eb-9fe3-67e357d0fa00.png)
> 
> We will also display a similar message when the graph model has no information (no nodes):
> 
> ![Screenshot 2021-01-10 at 18 14 20](https://user-images.githubusercontent.com/348973/104131741-3c6ab200-5370-11eb-8d6f-1901371ab21f.png)
> 
> ---
> 
> Other things we've considered:
> 
> - ~add an icon instead of the text in the toolbar~ - we'll leave the text label for now
> - ~create text labels instead of the hardcoded strings I'm using now~ - we decided not to do localisation while this view is experimental
> - I was on the fence about adding a 'no limit' option in the dropdown and decided against it. I guess it's useful in development when trying out pruning strategies, but it might surprise people unfamiliar with how it works and freeze their apps. In development, we can just remove the limit when we want to try things out.

Looks good to me. I can try my hand at an icon. :)

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

PR: https://git.openjdk.java.net/jmc/pull/193


More information about the jmc-dev mailing list