Kyro buffer underflow

Running gradle 1.8 under Hudson for a CI installation, the build is failing at variable points with a Kyro buffer underflow exception.

The stack trace is here: https://gist.github.com/anonymous/6886334.

From previous postings, this seems to be caused by a worker process exiting with a non-zero exit status (137)

I’m trying to debug it, and have a suspicion the worker is running out of memory. I’ve tried changing the JVM parameters with a -D switch, but it does not seem to affect it. So:

  • is there any way to see more diagnostic info from the worker? I don’t see any way to get memory info, exception/error stacks from the worker - what is the preferred way to give more memory to the worker processes? Since I can’t monitor them, I don’t know if I am giving gradle the right switches to do that.

  • The problem does not happen when running from the command line - can you suggest anything in the CI environment that might be affecting this.

All help much appreciated!

what is the preferred way to give more memory to the worker processes? Since I can’t monitor them, I don’t know if I am giving gradle the right switches to do that.

There are specific options on the test task: Test - Gradle DSL Version 8.4

The problem does not happen when running from the command line - can you suggest anything in the CI environment that might be affecting this.

Memory pressure is a likely culprit. If this is the case, the JVM will be trying to take more memory from the OS and will fail. Therefore, raising the max heap allocation for the JVM won’t help.

How consistent is the failure?

Luke, thanks for the update. The failure is 100% under CI, 0% on my local machine. Looking at the CI server setup, it’s very likely memory pressure as you suggest. We’ll try that first, and let you know.