Integrated: 7002: Too large graphs will freeze JMC

Alex Ciminian github.com+348973+cimi at openjdk.java.net
Wed Jan 13 22:02: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.

This pull request has now been integrated.

Changeset: b6fe7cac
Author:    Alex Ciminian <alexandru.ciminian at datadoghq.com>
Committer: Marcus Hirt <hirt at openjdk.org>
URL:       https://git.openjdk.java.net/jmc/commit/b6fe7cac
Stats:     125 lines in 2 files changed: 114 ins; 0 del; 11 mod

7002: Too large graphs will freeze JMC

Reviewed-by: hirt

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

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


More information about the jmc-dev mailing list