-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphviz: Set total memory by default to 2^30 #190
base: master
Are you sure you want to change the base?
Conversation
Set a high upper bound for total memory to prevent failure: > Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0
@@ -28,7 +28,7 @@ import java.io.File | |||
val dot = File(outputDirectory, generator.outputFileNameDot) | |||
dot.writeText(graph.toString()) | |||
|
|||
val graphviz = Graphviz.fromGraph(graph).run(generator.graphviz) | |||
val graphviz = Graphviz.fromGraph(graph).totalMemory(999999999).run(generator.graphviz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really need to be that high?
No but I think it’s an upper limit. Won’t be that high. But have to check
that.
A param would be better I agree.
Dependency diagrams have a tendency to become huge
On Tue, 9 Aug 2022 at 10:56, Niklas Baudy ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
src/main/kotlin/com/vanniktech/dependency/graph/generator/DependencyGraphGeneratorTask.kt
<#190 (comment)>
:
> @@ -28,7 +28,7 @@ import java.io.File
val dot = File(outputDirectory, generator.outputFileNameDot)
dot.writeText(graph.toString())
- val graphviz = Graphviz.fromGraph(graph).run(generator.graphviz)
+ val graphviz = Graphviz.fromGraph(graph).totalMemory(999999999).run(generator.graphviz)
Does it really need to be that high?
—
Reply to this email directly, view it on GitHub
<#190 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGH5MP4TOYB2U4GRIE3OXDVYIMLDANCNFSM5576P7EA>
.
You are receiving this because you authored the thread.Message ID:
<vanniktech/gradle-dependency-graph-generator-plugin/pull/190/review/1066358889
@github.com>
--
--
Tjerk Wolterink
|
Hi, I'm not sure we want to add this default for 2 reasons. And finally, there already is a way to do that today, through the same mechanism in the configuration block: graphviz = { it.totalMemory( /*...*/ ) } The Graphviz instance configuration has been added here: #183 This should cover the need of #174 |
@SimonMarquis like #173 (comment) what do you think if we provide a reasonable default for |
Yes we could provide such default, although I think bumping it to 2^25 would not change it that much. (2^24 is the current default)
|
Didn't know 2^24 is the default, then let's take 2^30? |
|
Yes it should be consistent. Let's go for 2^30 |
@tjerkw do you need help to merge this? I think we can add an extension like this in internal fun Graphviz.withDefaultTotalMemory() = totalMemory(2.0.pow(30).toInt()) And use it in both val graphviz = Graphviz.fromGraph(graph).withDefaultTotalMemory().run(generator.graphviz) |
@SimonMarquis Thanks! Updated it. I missed the discussion but thanks for the help. MR is updated. Feel free to merge. |
Sorry will fix |
That's what I feared unfortunately.
This setting is not only a limit, but forces to somewhat allocate part of the memory, which triggers this OOM. We could increase our But keep in mind users would have to do the same, which is not very obvious from the error message. |
Is there any updates? Are you going to merge it? |
As explained in my previous comment, this is not a "one size fits all" solution. Therefore and don't think we should merge this. Also, you can manually set it from your own configuration, right? |
Fixes #174
Set a high upper bound for total memory to prevent failure: