quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

ArC: optimize the generated dependency graphs for the Dev UI

Open mkouba opened this issue 7 months ago • 6 comments

Description

It can cause high memory consumption for apps with many beans (thousands) and complex hierarchy.

See also https://quarkusio.zulipchat.com/#narrow/channel/187030-users/topic/High.20memory.20consumption.20during.20build-phase.20on.20a.20big.20monolith

Implementation ideas

  • optimize the generated JSON
  • load the JSON on demand (?)
  • introduce a limit to turn this feature off automatically

mkouba avatar Apr 29 '25 13:04 mkouba

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip

This message is automatically generated by a bot.

quarkus-bot[bot] avatar Apr 29 '25 13:04 quarkus-bot[bot]

/cc @Ladicek (arc), @cescoffier (devui), @manovotn (arc), @phillip-kruger (devui)

quarkus-bot[bot] avatar Apr 29 '25 13:04 quarkus-bot[bot]

@mkouba just for people who are interested, could you point to the code that handles this?

Thanks

geoand avatar Apr 30 '25 11:04 geoand

@mkouba just for people who are interested, could you point to the code that handles this?

Thanks

Ofc, this would be a good starting point: https://github.com/quarkusio/quarkus/blob/main/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/devui/ArcDevModeApiProcessor.java#L66-L95

mkouba avatar Apr 30 '25 11:04 mkouba

🙏

geoand avatar Apr 30 '25 11:04 geoand

I've created a draft PR to test various options: https://github.com/quarkusio/quarkus/pull/47633

mkouba avatar Apr 30 '25 15:04 mkouba

introduce a limit to turn this feature off automatically

I believe this makes sense regardless of how efficiently the graph can be created and loaded because if there is a huge number of beans, how useful would the graph be anyway?

geoand avatar May 02 '25 07:05 geoand

introduce a limit to turn this feature off automatically

I believe this makes sense regardless of how efficiently the graph can be created and loaded because if there is a huge number of beans, how useful would the graph be anyway?

That's a good point. We could actually also disable this feature (skip graph generation) if a specific graph (we do generate one graph per bean) contains more than N dependencies. Note that we currently limit the "visible depth" to 10 levels (in Dev UI 1 it was configurable but it's hardcoded in Dev UI 2).

mkouba avatar May 05 '25 06:05 mkouba

👍🏽

geoand avatar May 05 '25 06:05 geoand

Should we close this now that https://github.com/quarkusio/quarkus/pull/47633 is in?

geoand avatar May 06 '25 14:05 geoand

Should we close this now that #47633 is in?

Yes, we could reopen if the problem reappears...

mkouba avatar May 06 '25 14:05 mkouba

👌🏽

geoand avatar May 06 '25 14:05 geoand