question

INvBhosale avatar image
INvBhosale asked INvBhosale commented

Not able to start Studio on Windows, getting "OutOfMemoryError: Java heap space"

Trying to run on Windows 10 with 32gb ram and keep getting below errors. Any solution?

C:\datastax-studio-6.8.20\bin>server.bat
Starting Studio. This may take a few minutes. You will be notified here when Studio is ready.
Looking for Java in path.
Java version located 1.8
Starting === Exception in thread "Thread-0" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Unknown Source)
        at java.lang.String.<init>(Unknown Source)
        at java.lang.String.substring(Unknown Source)
        at com.datastax.studio.server.Bootstrap$ProgressBarTraditional.run(Bootstrap.java:638)
Uncaught error from thread [Studio-eventuate.log.dispatchers.read-dispatcher-43]: Java heap space, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for for ActorSystem[Studio]
java.lang.OutOfMemoryError: Java heap space
        at java.util.LinkedList.linkBefore(Unknown Source)
        at java.util.LinkedList.add(Unknown Source)
        at com.datastax.studio.notebook.serialization.model.ListWithNulls.lambda$toListWithNulls$0(ListWithNulls.java:48)
        at com.datastax.studio.notebook.serialization.model.ListWithNulls$$Lambda$142/23907272.accept(Unknown Source)
        at java.lang.Iterable.forEach(Unknown Source)
        at com.datastax.studio.notebook.serialization.model.ListWithNulls.toListWithNulls(ListWithNulls.java:47)
        at com.datastax.studio.notebook.serialization.V1NotebookSerializer.toCurrentCQLRowData(V1NotebookSerializer.java:920)
        at com.datastax.studio.notebook.serialization.V1NotebookSerializer.toCurrentResultValue(V1NotebookSerializer.java:829)
        at com.datastax.studio.notebook.serialization.V1NotebookSerializer.lambda$toCurrentList$11(V1NotebookSerializer.java:930)
        at com.datastax.studio.notebook.serialization.V1NotebookSerializer$$Lambda$141/8766067.accept(Unknown Source)
        at java.lang.Iterable.forEach(Unknown Source)
        at com.datastax.studio.notebook.serialization.V1NotebookSerializer.toCurrentList(V1NotebookSerializer.java:928)
        at com.datastax.studio.notebook.serialization.V1NotebookSerializer.toCurrentResultValue(V1NotebookSerializer.java:813)
        at com.datastax.studio.notebook.serialization.V1NotebookSerializer.toCurrentResult(V1NotebookSerializer.java:406)
        at com.datastax.studio.notebook.serialization.V1NotebookSerializer.toCurrentCell(V1NotebookSerializer.java:312)
        at com.datastax.studio.notebook.serialization.V1NotebookCellUpdatedEventSerializer.toCurrent(V1NotebookCellUpdatedEventSerializer.java:32)
        at com.datastax.studio.notebook.serialization.V1NotebookCellUpdatedEventSerializer.toCurrent(V1NotebookCellUpdatedEventSerializer.java:11)
        at com.datastax.studio.api.common.serialization.ProtocolBuffersJsonSerializer.deserialize(ProtocolBuffersJsonSerializer.java:51)
        at com.datastax.studio.api.common.serialization.DefaultSerializerRegistry.fromInputStream(DefaultSerializerRegistry.java:307)
        at com.datastax.studio.api.common.serialization.DefaultSerializerRegistry.fromBinary(DefaultSerializerRegistry.java:290)
        at com.datastax.studio.api.common.serialization.DefaultSerializerRegistry.fromBinary(DefaultSerializerRegistry.java:281)
        at akka.serialization.Serialization$$anonfun$deserialize$1.apply(Serialization.scala:128)
        at scala.util.Try$.apply(Try.scala:192)
        at akka.serialization.Serialization.deserialize(Serialization.scala:122)
        at com.rbmhtechnology.eventuate.serializer.DelegatingPayloadSerializer.payload(PayloadSerializer.scala:72)
        at com.rbmhtechnology.eventuate.serializer.DurableEventSerializer.durableEvent(DelegatingDurableEventSerializer.scala:144)
        at com.rbmhtechnology.eventuate.serializer.DurableEventSerializer.fromBinary(DelegatingDurableEventSerializer.scala:78)
        at akka.serialization.Serialization$$anonfun$deserialize$3.apply(Serialization.scala:204)
        at scala.util.Try$.apply(Try.scala:192)
        at akka.serialization.Serialization.deserialize(Serialization.scala:204)
        at com.rbmhtechnology.eventuate.log.leveldb.LeveldbEventLog.com$rbmhtechnology$eventuate$log$leveldb$LeveldbEventLog$$event(LeveldbEventLog.scala:255)
        at com.rbmhtechnology.eventuate.log.leveldb.LeveldbEventLog$EventIterator$$anonfun$5.apply(LeveldbEventLog.scala:235)
done.
studio
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered

The stack trace you posted indicates the Studio JVM is running out of memory while loading one of your notebooks which has cells that contain a large result and are filling up the heap.

There are cell execution properties in configuration.yaml which should limit the size of the results:

# Maximum number of items returned per cell execution. Result set will be
# truncated to this number of rows, edges, vertices, etc.
# Default: 1000 items
resultSizeLimit: 1000

# Graph: maximum content length returned for a cell result (bytes).
# Default: 524288 bytes
maxResultSizeBytes: 524288

However, if you've imported a notebook from an older version of Studio, these limits would not have been applied.

You can workaround the issue by moving the .datastax_studio/ directory to another location then restart Studio. You can then try to import each notebook, one by one.

If this doesn't work and if you have any follow up questions, please log a ticket with DataStax Support so one of our engineers can assist you. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

djatnieks avatar image
djatnieks answered INvBhosale commented

Another option may be to increase the maximum amount of memory that can be used by Studio with the java Xmx option. The default maximum is OS dependent and may be less than expected - I have a 32Gb Mac and the default max java memory is 8Gb.

This can be set in the setenv.bat file in these lines:

rem Optional JVM arguments 
set STUDIO_JVM_ARGS=  

Thank you for providing a stack trace - a bug has been filed and will be addressed in an upcoming 6.8 patch release.

1 comment Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

INvBhosale avatar image INvBhosale commented ·

Sorry for delayed response as I was on paternity leave. I tried both the suggested options and no luck. Even downloaded newer version but still no luck. I think I will log a ticket and get help from engineer. Thanks for responding.

0 Likes 0 ·