Intellij - Gradle - OSX - Where is the build cache ?

Hello dear IntelliJ-users,

I am trying to build a Gradle-based Android project but my IDE (IntelliJ Ultimate 13.1) is failing hard while trying to assemble my project :

Error:Internal error: (java.lang.OutOfMemoryError) Java heap space

java.lang.OutOfMemoryError: Java heap space

 at org.jetbrains.jps.incremental.storage.TimestampStorage$StateExternalizer.read(TimestampStorage.java:126)

 at org.jetbrains.jps.incremental.storage.TimestampStorage$StateExternalizer.read(TimestampStorage.java:115)

 at com.intellij.util.io.PersistentHashMap.doGet(PersistentHashMap.java:427)

 at com.intellij.util.io.PersistentHashMap.get(PersistentHashMap.java:398)

 at org.jetbrains.jps.incremental.storage.AbstractStateStorage.getState(AbstractStateStorage.java:118)

 at org.jetbrains.jps.incremental.storage.TimestampStorage.getStamp(TimestampStorage.java:52)

 at org.jetbrains.jps.incremental.FSOperations.traverseRecursively(FSOperations.java:197)

 at org.jetbrains.jps.incremental.FSOperations.traverseRecursively(FSOperations.java:189)

 at org.jetbrains.jps.incremental.FSOperations.traverseRecursively(FSOperations.java:189)

 at org.jetbrains.jps.incremental.FSOperations.traverseRecursively(FSOperations.java:189)

 at org.jetbrains.jps.incremental.FSOperations.traverseRecursively(FSOperations.java:189)

 at org.jetbrains.jps.incremental.FSOperations.traverseRecursively(FSOperations.java:189)

 at org.jetbrains.jps.incremental.FSOperations.traverseRecursively(FSOperations.java:189)

 at org.jetbrains.jps.incremental.FSOperations.traverseRecursively(FSOperations.java:189)

 at org.jetbrains.jps.incremental.FSOperations.markDirtyFiles(FSOperations.java:174)

 at org.jetbrains.jps.incremental.BuildOperations.initTargetFSState(BuildOperations.java:72)

 at org.jetbrains.jps.incremental.BuildOperations.ensureFSStateInitialized(BuildOperations.java:64)

 at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:850)

 at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:772)

 at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:595)

 at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:352)

 at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:184)

 at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:129)

 at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:224)

 at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)

 at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:133)

 at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)

 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

 at java.util.concurrent.FutureTask.run(FutureTask.java:262)

 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

 at java.lang.Thread.run(Thread.java:744)

By reading the stack trace, i suggested that it was a problem of a corrupted "build cache" so I tried to re-clone my repo in a full-new folder and try again to re-import and re-build my project and IntelliJ succeded to build the newly-created project.

By assuming my project is in $HOME/project/myproject, where is supposed to be the "build cache" that is breaking my build ?
I already tried to invalidate cache/restart but this is doing nothing.

Thanks for reading and, hopefully, for helping.

Pierre.

3 comments

Answering my own question :

There is a cache located in
/Users/me/Library/Caches/IntelliJIdea13

I dont know what each folder in this cache were so i deleted everything, restarted my IDE and everything is now up and running properly.

I love this IDE, but when it's working good ;D

Kepp up the nice work !  

0

Hi Pierre,
The build cache can be also indirectly cleared with "Rebuild project" action: every time you do full rebuild, not only the whole project is fully rebuilt, but also all caches are deleted and re-created again.

0

Thanks for pointing that out.
It's always good to know !

0

Please sign in to leave a comment.