I tried to make a column of my Room database unique by defining indices. However, this caused my compiler to fail, as it drastically increases the required object heap.
If I use @Entity(tableName = "seeds", indices = {@Index(value = {"name"}, unique = true)}) @Fts4
I get a compiler error when running "gradlew build --stacktrace":
Error occurred during initialization of VM
Could not reserve enough space for 3145728KB object heap
If I just use @Entity(tableName = "seeds") @Fts4
, the app properly compiles.
I tried different settings in my gradle.properties
...
org.gradle.jvmargs=-Xmx3g
was the largest value I could give it. At 4g
it complains that the value exceeds the allowed maximum. So all other SO threads regarding this are not helpfull as I already went to the maximum. I usually have it at 2g
. So this "small" change seems to double the required object heap.
Does anyone know a better way to handle unique indices?
Does anyone know how to solve the object heap issue at this level?