emory-courses / dsa-java

Data Structures and Algorithms in Java
https://emory.gitbook.io/dsa-java/
42 stars 55 forks source link

[HW3] outOfMemoryError #193

Closed kxiao02 closed 3 years ago

kxiao02 commented 3 years ago

I currently find my self building a heap that I suppose is greater than 600MB and it returns a outOfMemoryError. How is this possible? Could anyone give me some advice on how to fix this?

marvinquiet commented 3 years ago

How many vertices and edges do you have?

lujiaying commented 3 years ago

Could you take a look at https://www.jetbrains.com/help/idea/increasing-memory-heap.html ?

kxiao02 commented 3 years ago

@marvinquiet I only ran the default test. The code runs flawlessly on my friends Mac also my Windows10 pc. I will try to modify the settings and see if it works.

kxiao02 commented 3 years ago

@lujiaying Yes I have tried to increase the memory heap to 5120m and it still won't pass. I asked my friend to run this code with JProfiler and he says there is always a memory threshold around 500m under my IDE configs and it gives OOM as soon as the memory usage exceeds this threshold.

lujiaying commented 3 years ago

@lujiaying Yes I have tried to increase the memory heap to 5120m and it still won't pass. I asked my friend to run this code with JProfiler and he says there is always a memory threshold around 500m under my IDE configs and it gives OOM as soon as the memory usage exceeds this threshold.

Yeah there could be some ways to get rid of the memory constrain.

kxiao02 commented 3 years ago

Hi sorry for the late update. I have managed to fix the issue after I made some little tweaks to the algorithm. It must have been the wrongly generated STs that caused this problem.