Spaceship Demo Memory Leak?

53 views
Skip to first unread message

Vocs Ong

unread,
Jun 3, 2014, 11:11:47 PM6/3/14
to spaceba...@googlegroups.com
I'm running your Spaceship Demo 2.0
It started with ~600mb of memory (Private Working Set)
Left it overnight for abt ~24hrs 
It went up to >1gb of memory...

Not sure if its a leak or what causes the memory to keep going up.
Am concern if its related to Spacebase.

pron

unread,
Jun 4, 2014, 5:28:03 AM6/4/14
to spaceba...@googlegroups.com
While it's possible there's a memory leak (more likely in Quasar, which is under much more rapid development than SpaceBase), the fact that the RAM usage grows does not demonstrate that. The Java GC might say, "hey, there's more RAM available! If I use some more I might be able to make things run faster!", and then take up more RAM. To check if there's a leak, specify a maximum heap size with -Xmx on the Java command line (or in a "jvmArg" line in the build.gradle file) -- say, -Xmx1000m for 1000 MB -- and then leave it running and see if you get an OutOfMemoryError.

It's best to start with a smaller size of Xmx, see that it doesn't crash within the first five minutes, and if it doesn't, see if it crashes after a few hours. If it does -- there's a leak.

Vocs Ong

unread,
Jun 4, 2014, 10:48:45 PM6/4/14
to spaceba...@googlegroups.com
Thanks for the details.
I tried setting the Xmx to 600 with -Xmx600m in build.gradle file as such:

    // memory
    jvmArgs '-Xmx600m'

Ran the application for awhile and it hits Commit Size of over 810,248K and it does seems to stay around this value for my short period of 10-15mins test..
I've yet to go into exploring the codes, just running some surface test on the demo for quick reviews on Spacebase and Quasar.

Possible explanations include:
  • lots and lots of thread stacks,
  • memory-mapped files that are not being closed when they should be,
  • some native code library using (possibly leaking) out-of-heap memory.
It seems like highly it could be because of Quasar for the high number of thread counts.

Moving on.. is there some kind of "simple demo" for Spacebase in java/c++/nodejs to quick start with?
And since Spacebace is java based, will the performance be compromised when working on other languages API?

pron

unread,
Jun 5, 2014, 8:21:15 AM6/5/14
to spaceba...@googlegroups.com
The SpaceBase download includes examples in Java, Node.js, Python, Ruby and Erlang. The C++ API is currently unmaintained due to lack of interest.
Now, when you don't use SpaceBase from Java (or another JVM language), you lose SpaceBase's ability to parallelize your business logic (in the callbacks or through Quasar). The Node/Python/Ruby APIs use Thrift, which basically means you're using SpaceBase as a super-fast spatial Redis. Obviously some performance is lost, but you lose a lot of performance anyway if you're not running on the JVM (well, unless you're writing C/C++).
Reply all
Reply to author
Forward
0 new messages