Skip to content
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

[bazel.build] Problem with /rules/performance #18467

Closed
keddad opened this issue May 22, 2023 · 4 comments
Closed

[bazel.build] Problem with /rules/performance #18467

keddad opened this issue May 22, 2023 · 4 comments
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup)

Comments

@keddad
Copy link
Contributor

keddad commented May 22, 2023

Page link:

https://bazel.build/rules/performance

Problem description (include actual vs expected text, if applicable):

For memory profiling, documentation suggests using these arguments:

STARTUP_FLAGS=\
  --host_jvm_args=-javaagent:$(BAZEL)/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \
  --host_jvm_args=-DRULE_MEMORY_TRACKER=1

It says that .jar file should be in the repository: "The bazel repository comes with an allocation instrumenter. ". However, it appears that this .jar (as well as some other files) was migrated away it this commit. One could still get the .jar using commit history, but the documentation should probably include an updated way to fetch the .jar.

Where do you see this issue? (include link to specific section of the page, if applicable)

Link to section

Any other information you'd like to share?

No response

@keddad keddad added team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup) untriaged labels May 22, 2023
@meisterT
Copy link
Member

cc @meteorcloudy

@meteorcloudy
Copy link
Member

Is this still the recommended way to Enabling memory tracking? I'm not familiar with how the memory profiler works, but I'm a bit surprised it depends on a jar file from the Bazel source tree.

If depending on an user provided jar file is still required, I think we can recommend users to download the jar from Maven central repository.

@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jun 15, 2023
@liam-baker-sm
Copy link

liam-baker-sm commented Jul 13, 2023

Another vote for this issue!
Trying to debug an intermittent crash during the analysis phase (before any compilation starts)

 Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/home/jenkins/jenkins_root/workspace/.../build/bbb2ff1e17e2720bb620a5cdb48747bb/server/jvm.out')

The jvm.out referred to is completely empty (0 bytes), and the java.log abruptly ends.

Developer could reproduce on their machine with some out of heap error printed to their terminal

230712 04:29:52.101:I 11 [com.google.devtools.build.lib.metrics.PostGCMemoryUseRecorder.handleNotification] Memory use after full GC: 2160238688
230712 04:29:53.550:XT 22 [com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively] Shutting down due to exception
java.lang.OutOfMemoryError: Java heap space
	at java.base/java.util.Arrays.copyOf(Unknown Source)
	at java.base/java.util.ArrayList.grow(Unknown Source)
	at java.base/java.util.ArrayList.grow(Unknown Source)
	at java.base/java.util.ArrayList.add(Unknown Source)
	at java.base/java.util.ArrayList.add(Unknown Source)
	at com.google.devtools.build.skyframe.InMemoryNodeEntry.appendToReverseDepOperations(InMemoryNodeEntry.java:361)
	at com.google.devtools.build.skyframe.InMemoryNodeEntry.addReverseDepAndCheckIfDone(InMemoryNodeEntry.java:317)
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.enqueueChild(AbstractParallelEvaluator.java:302)
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:823)
	at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:382)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

The next step would be memory profiling, but the documented steps refer to that missing file java-allocation-instrumenter-3.3.0.jar

@liam-baker-sm
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup)
Projects
None yet
Development

No branches or pull requests

6 participants