Out of memory error

59 views
Skip to first unread message

.

unread,
May 12, 2020, 2:26:41 PM5/12/20
to scalismo
Hello
I was trying to perform registration between my aligned meshes and reference, and while I got no error in the code, I get the following when I run it:

Capture.PNG

I googled the error, and found this problem might be caused due to the Java heap memory being too low, and how to increase the memory. However, I am not able to perform the indicated steps either. What could be going wrong here?

Behzad Vafaeian

unread,
May 12, 2020, 2:36:19 PM5/12/20
to ., scalismo

--
You received this message because you are subscribed to the Google Groups "scalismo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/74715d58-8ec5-4696-a5d8-ff1ef205619d%40googlegroups.com.

.

unread,
May 12, 2020, 4:07:29 PM5/12/20
to scalismo
Thanks a lot. It worked!


On Wednesday, 13 May 2020 00:06:19 UTC+5:30, Behzad@UofA wrote:
On Tue, May 12, 2020 at 10:56 PM . <aasth...@gmail.com> wrote:
Hello
I was trying to perform registration between my aligned meshes and reference, and while I got no error in the code, I get the following when I run it:

Capture.PNG

I googled the error, and found this problem might be caused due to the Java heap memory being too low, and how to increase the memory. However, I am not able to perform the indicated steps either. What could be going wrong here?

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

.

unread,
May 13, 2020, 2:25:39 PM5/13/20
to scalismo
Hello
I changed the code a bit, and the problem still persists. I am getting a 'GC overhead limit exceeded' error, even though I have already increased the heap memory to maximum. How do I resolve this?


On Wednesday, 13 May 2020 00:06:19 UTC+5:30, Behzad@UofA wrote:
On Tue, May 12, 2020 at 10:56 PM . <aasth...@gmail.com> wrote:
Hello
I was trying to perform registration between my aligned meshes and reference, and while I got no error in the code, I get the following when I run it:

Capture.PNG

I googled the error, and found this problem might be caused due to the Java heap memory being too low, and how to increase the memory. However, I am not able to perform the indicated steps either. What could be going wrong here?

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

Marcel Luethi

unread,
May 13, 2020, 2:47:45 PM5/13/20
to ., scalismo
Hi,

Do you use a really large dataset? How many vertices does your reference mesh have? We regularly work with meshes of up to 100'000 vertices.

Best regards,

Marcel

On Wed, May 13, 2020 at 8:25 PM . <aasth...@gmail.com> wrote:
Hello
I changed the code a bit, and the problem still persists. I am getting a 'GC overhead limit exceeded' error, even though I have already increased the heap memory to maximum. How do I resolve this?

On Wednesday, 13 May 2020 00:06:19 UTC+5:30, Behzad@UofA wrote:

On Tue, May 12, 2020 at 10:56 PM . <aasth...@gmail.com> wrote:
Hello
I was trying to perform registration between my aligned meshes and reference, and while I got no error in the code, I get the following when I run it:

Capture.PNG

I googled the error, and found this problem might be caused due to the Java heap memory being too low, and how to increase the memory. However, I am not able to perform the indicated steps either. What could be going wrong here?

--
You received this message because you are subscribed to the Google Groups "scalismo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/74715d58-8ec5-4696-a5d8-ff1ef205619d%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "scalismo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo/3824fa87-a27f-45bc-972e-2d0c807018ac%40googlegroups.com.

Marcel Luethi

unread,
May 13, 2020, 2:56:47 PM5/13/20
to Aastha Jain, scalismo
In this case it should not be a problem. Are you using the code from Tutorial 11 or Tutorial 12 (https://scalismo.org/tutorials/tutorial11.html)?



On Wed, May 13, 2020 at 8:49 PM Aastha Jain <aasth...@gmail.com> wrote:
I'm using the dataset provided as a part of the femur project in the online course

Marcel Luethi

unread,
May 14, 2020, 1:42:05 AM5/14/20
to Aastha Jain, scalismo
Hi,

You say that you are using the code from the tutorial and the meshes from the femur project. In this case it should work, as many people have done this before. Could it be possible that you are using a 32 bit JVM instead of the 64bit?

I cannot directly debug your code. But if you are able to localize in what statement (or part of the code) the problem occurs, I might be able to give you some hints.

Best regards,

Marcel

On Wed, May 13, 2020 at 9:20 PM Aastha Jain <aasth...@gmail.com> wrote:
Hi
I realised where the problem was. I had updated the memory size of the application instead of the IDE. Doing the needful takes away the previous error. However, now I get another error 'java.lang.OutOfMemoryError: Java heap space'. Could you help me resolve this? Would you have some time to look at my code?
Thanks in advance

On Thu, 14 May 2020 at 00:28, Aastha Jain <aasth...@gmail.com> wrote:
Tutorial 12.

Marcel Luethi

unread,
May 14, 2020, 8:17:14 AM5/14/20
to Aastha Jain, scalismo
I see that you are displaying all 49 meshes simultaneously in scalismo-ui. This needs a lot of memory and is also not useful for debugging.

Does it solve your problem if you don't visualize them all?

Best,
Marcel

On Thu, May 14, 2020 at 8:59 AM Aastha Jain <aasth...@gmail.com> wrote:
There must be some error in the loop. When i tried establishing correspondence for a single example mesh with the reference, it worked out fine.
Best,
Aastha

On Thu, 14 May 2020 at 12:27, Aastha Jain <aasth...@gmail.com> wrote:
Sure, got it. I am using the 64 bit version only. Here is a snippet of the code which is creating the problem. Any suggestions would be appreciated. Thanks!
val refMesh = MeshIO.readMesh(alignedMeshFiles(0)).get

val targetMeshes: Array[TriangleMesh[_3D]] = alignedMeshFiles.map(meshFile => MeshIO.readMesh(meshFile).get)

val LMFiles = new java.io.File("C:/Users/Home/Desktop/jjn/internship/Courses_SSM2016_Training_step2/step2/landmarks").listFiles()
val LMs: Array[scala.Seq[Landmark[_3D]]] =LMFiles.map(f => LandmarkIO.readLandmarksJson[_3D](f).get)


val refLMs = LMs(0)
val refLMNodeIds = refLMs.map(eachLM => refMesh.pointSet.findClosestPoint(eachLM.point).id)

val knownDeformations = (1 until 49).map(i => {
LMs(0).indices.map(j => LMs(i + 1)(j).point - refMesh.pointSet.point(refLMNodeIds(j)))
})

val refLMpoints = refLMNodeIds.toIndexedSeq.map(eachId => refMesh.pointSet.point(eachId))
val refLMdomain = UnstructuredPointsDomain(refLMpoints)
val knownDeformationFields = knownDeformations.map(eachDefSet => {
DiscreteField[_3D, UnstructuredPointsDomain[_3D], EuclideanVector[_3D]](refLMdomain, eachDefSet)
})

val noise = MultivariateNormalDistribution(DenseVector.zeros[Double](3), 0.001 * DenseMatrix.eye[Double](3))

def RegressionDataGenerator(dataPoints: IndexedSeq[Point[_3D]], deformations: IndexedSeq[EuclideanVector[_3D]], noise: MultivariateNormalDistribution) = {
val regressionDataSet = dataPoints.indices.map(i => (dataPoints(i), deformations(i), noise))
regressionDataSet
}

val regressionDataSets = (1 until 49).map(i => RegressionDataGenerator(refLMpoints, knownDeformations(i), noise))
for (n <- 1 until 49) {
val posteriorGP = reflowRankGP.posterior(regressionDataSets(n))
val initialCoefficients = DenseVector.zeros[Double](posteriorGP.rank)
val registrationParameters = Seq(
RegistrationParameters(regularizationWeight = 1e-1, numberOfIterations = 20, numberOfSampledPoints = 1000),
RegistrationParameters(regularizationWeight = 1e-2, numberOfIterations = 30, numberOfSampledPoints = 1000),
RegistrationParameters(regularizationWeight = 1e-4, numberOfIterations = 40, numberOfSampledPoints = 2000),
RegistrationParameters(regularizationWeight = 1e-6, numberOfIterations = 50, numberOfSampledPoints = 4000)
)
val finalCoefficients = registrationParameters.foldLeft(initialCoefficients)((modelCoefficients, regParameters) =>
doRegistration(posteriorGP, refMesh, targetMeshes(n), regParameters, modelCoefficients))
val transformationSpace = GaussianProcessTransformationSpace(posteriorGP)
val registrationTransformation = transformationSpace.transformForParameters(finalCoefficients)
val fittedMesh = refMesh.transform(registrationTransformation)
val fittedMeshGroup = ui.createGroup("fittedMeshGroup")
ui.show(fittedMeshGroup, fittedMesh, "fittedMesh")
ui.show(fittedMeshGroup, targetMeshes(n), s"TargetMesh $n")
Reply all
Reply to author
Forward
Message has been deleted
0 new messages