Re: Java heap space error

50 views
Skip to first unread message
Message has been deleted
Message has been deleted

Andreas Forster

unread,
Jan 16, 2018, 5:08:32 AM1/16/18
to Jerry Liu, scalismo-faces
Hi Jerry,

It seems that your JVM ran out of memory. The JVM does not take all your memory if you do not explicitly specify it. Did you pass the JVM options -Xmx2g  (see doc) to let it use 2 gigabytes of memory? If yes can you increase it even more e.g. -Xmx4g?

Hope this will fix the issue.

Best regards
Andreas


On Mon, Jan 15, 2018 at 9:28 PM, Jerry Liu <3jer...@gmail.com> wrote:
If it helps, this is what the visualizer looks like when I try to run it. When I ran one of the landmark files, it seemed to work, but the model tab is empty and trying to reload it or double click it does nothing.



On Monday, January 15, 2018 at 3:25:11 PM UTC-5, Jerry Liu wrote:
Hi there,

I downloaded the Probabilistic Fitting tutorial, and added the model2017-1_face12_nomouth.h5 file into the data folder. I then ran the tutorial, but in all parts that require getting the shapeModel, I get the following error message:

java.lang.OutOfMemoryError: Java heap space

For example, I ran the following code line by line: 

import java.io.File

import scalismo.io.StatismoIO
import scalismo.statisticalmodel.StatisticalMeshModel

val modelLocation: String = "data/model2017-1_face12_nomouth.h5"
val shapeModel: StatisticalMeshModel = StatismoIO.readStatismoMeshModel(new File(modelLocation), "/shape").get

Every line worked successfully, included the modelLocation initialization, except for the last one. The shapeModel line produced the error I described above, and I believe at one point I got an error associated with no shape model being found. 

Do you have any explanation for this? Any help would be greatly appreciated!


--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.
To post to this group, send email to scalism...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo-faces/9dd61afa-5a60-4365-a742-b3aa0dbf6661%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
*****************************************
Dr. Andreas Morel-Forster
Departement Mathematik und Informatik
Spiegelgasse 1
CH-4051 Basel
PHONE: +41 61 207 05 52
MAIL: Andreas.Forster@unibas.ch
*****************************************
Message has been deleted
Message has been deleted

Andreas Forster

unread,
Jan 16, 2018, 9:54:03 AM1/16/18
to Jerry Liu, scalismo-faces
Hi Jerry,

do you use 64bit JVM? And does your machine have enough (2gb) free memory when you start the tutorial?

Best regards
Andreas

On Tue, Jan 16, 2018 at 3:01 PM, Jerry Liu <3jer...@gmail.com> wrote:
Hi Andreas,

I tried that using the command java -Xmx2g -jar scalismoLab-faces.jar but it gave the error "Could not reserve enough space for 2097152KB object heap" and I also went to my Java control panel and the runtime environment settings and changed the Runtime parameters to -Xmx4g, -Xmx2g, -Xmx512m, as well as with -Xms for all but I still got the error. Would you know why this is the case or a solution? Maybe I need to change permissions somewhere?

Note: It works if I do java -Xmx1g -jar scalismoLab-faces.jar and works for the most part, so it's just setting the allowable memory that's giving me the issue.

Thank you,
Jerry

On Tuesday, January 16, 2018 at 5:08:32 AM UTC-5, Andreas Forster wrote:
Hi Jerry,

It seems that your JVM ran out of memory. The JVM does not take all your memory if you do not explicitly specify it. Did you pass the JVM options -Xmx2g  (see doc) to let it use 2 gigabytes of memory? If yes can you increase it even more e.g. -Xmx4g?

Hope this will fix the issue.

Best regards
Andreas

On Mon, Jan 15, 2018 at 9:28 PM, Jerry Liu <3jer...@gmail.com> wrote:
If it helps, this is what the visualizer looks like when I try to run it. When I ran one of the landmark files, it seemed to work, but the model tab is empty and trying to reload it or double click it does nothing.



On Monday, January 15, 2018 at 3:25:11 PM UTC-5, Jerry Liu wrote:
Hi there,

I downloaded the Probabilistic Fitting tutorial, and added the model2017-1_face12_nomouth.h5 file into the data folder. I then ran the tutorial, but in all parts that require getting the shapeModel, I get the following error message:

java.lang.OutOfMemoryError: Java heap space

For example, I ran the following code line by line: 

import java.io.File

import scalismo.io.StatismoIO
import scalismo.statisticalmodel.StatisticalMeshModel

val modelLocation: String = "data/model2017-1_face12_nomouth.h5"
val shapeModel: StatisticalMeshModel = StatismoIO.readStatismoMeshModel(new File(modelLocation), "/shape").get

Every line worked successfully, included the modelLocation initialization, except for the last one. The shapeModel line produced the error I described above, and I believe at one point I got an error associated with no shape model being found. 

Do you have any explanation for this? Any help would be greatly appreciated!


--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-face...@googlegroups.com.

To post to this group, send email to scalism...@googlegroups.com.



--
*****************************************
Dr. Andreas Morel-Forster
Departement Mathematik und Informatik
Spiegelgasse 1
CH-4051 Basel
PHONE: +41 61 207 05 52
MAIL: Andreas...@unibas.ch
*****************************************

--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages