RFR: 7885: Graphical rendering of dependency view fails due to heap memory drain [v2]

Virag Purnam vpurnam at openjdk.org
Thu Aug 31 05:53:09 UTC 2023


On Wed, 23 Aug 2023 19:41:19 GMT, Vincent Alexander Beelte <duke at openjdk.org> wrote:

>> Virag Purnam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   7885: Graphical rendering of dependency view fails due to heap memory drain
>
> Sure go ahead and adapt that idea however you see fit. I had already gotten approval to contribute that myself from Accenture but I never did because in the end I felt it wasn't enough of an improvement.
> Even with that change I could easily make the JSONs big enough that they won't fit into the Java array size limits. And I did not even need to use abnormally large recordings for that.
> I think fully removing the JSONs is not easily possible but you might want to explore changing the format unless there are consumers outside the scope of what you could change.
> I imagine there might be a lot of duplicate content in those JSONs like maybe stacktraces or class names. You could implement a manual dictionary compression (I believe that's the word for what I am proposing).
> Instead of for example
> 
> {
>     "people": [
>         {
>             "firstName": "John",
>             "lastName": "Smith"
>         },
>         {
>             "firstName": "Max",
>             "lastName": "Miller"
>         },
>         {
>             "firstName": "Max",
>             "lastName": "Smith"
>         },
>         {
>             "firstName": "John",
>             "lastName": "Miller"
>         }
>     ]
> }
> 
> you could do this
> 
> {
>     "people": [
>         {
>             "firstName": 0,
>             "lastName": 1
>         },
>         {
>             "firstName": 2,
>             "lastName": 3
>         },
>         {
>             "firstName": 2,
>             "lastName": 1
>         },
>         {
>             "firstName": 0,
>             "lastName": 3
>         }
>     ],
>     "strings": ["John", "Smith", "Max", "Miller"]
> }
> 
> In this example the last JSON wasn't actually smaller in terms of characters because the names are too short, but I think I have shown the idea.

I have updated this PR with the changes suggested by @grandmasterpixel. Could somebody please review the changes. Thanks

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

PR Comment: https://git.openjdk.org/jmc/pull/511#issuecomment-1700406211


More information about the jmc-dev mailing list