How can we tune JVM memory?

I tune the Metaspace memory in gradle.properties file:

org.gradle.jvmargs=-XX:MaxMetaspaceSize=100m

And I’ve set a disactive locking in build.gradle file:

buildscript {
    configurations.classpath {
        resolutionStrategy.deactivateDependencyLocking()
    }
}

But I still get an eror:

Gradle could not start your build.
> Could not create service of type FileAccessTimeJournal using GradleUserHomeScopeServices.createFileAccessTimeJournal().
   > Timeout waiting to lock journal cache (C:\Users\User\.gradle\caches\journal-1). It is currently in use by another Gradle instance.
     Owner PID: 7076
     Our PID: 6468
     Owner Operation: 
     Our operation: 
     Lock file: C:\Users\User\.gradle\caches\journal-1\journal-1.lock

Caused by: org.gradle.cache.LockTimeoutException: Timeout waiting to lock journal cache (C:\Users\User\.gradle\caches\journal-1). It is currently in use by another Gradle instance.
Owner PID: 7076
Our PID: 6468
Owner Operation: 
Our operation: 
Lock file: C:\Users\User\.gradle\caches\journal-1\journal-1.lock

I don’t imagine what’s problem. Can someone help?

Neither the error, nor dependency locking has anything to do with tuning JVM memory.

The error is quite meaningful, isn’t it?
Gradle wants to access a lock that is held by a different process and couldn’t get it in time.
Check what process with PID 7076 is and maybe kill it or just reboot your computer.

The rebooting my computer didn’t help, but I killed the process with the PID and it works. Thanks!

If after rebooting there was still a process locking that cache, you maybe should investigate what process is that and why it blocks that cache for so long. :slight_smile: