Author Topic: Error: out of memory  (Read 7963 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Error: out of memory
« Reply #15 on: March 25, 2006, 12:41:38 pm »
Try this to narrow it down:

Start your app with "-Xms256m -Xmx256m" to set initial and max memory to the same value, so that no further memory allocation happens while running the program. Then call this method before and after doing...whatever...to see if this "whatever" maybe causes the problem.

Code: [Select]

public void memUsed() {
    Runtime rt=Runtime.getRuntime();
    System.out.println("Memory used: "+(rt.totalMemory()-rt.freeMemory()));
}

Offline manumoi

  • long
  • ***
  • Posts: 121
    • View Profile
    • http://www.iro.umontreal.ca/~blanchae
Error: out of memory
« Reply #16 on: March 27, 2006, 08:14:46 pm »
hello, maybe you can show us your JPCT code if it s not copyrighted (or some parts only if too big).
Currently i have no clue on your problem.

Manu

Offline Melssj5

  • double
  • *****
  • Posts: 715
    • View Profile
Error: out of memory
« Reply #17 on: April 07, 2006, 02:21:36 am »
It happens when creating a new World. I mean when calling to the constructor.

Memory used: 6209920
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

I have not posted in many time because I have had no time.
Nada por ahora

Offline Melssj5

  • double
  • *****
  • Posts: 715
    • View Profile
Error: out of memory
« Reply #18 on: April 07, 2006, 02:24:27 am »
ok ok, I have found the problem that delayed me 3 weeks. Just was for a high value for Config.maxPolysVisible.

Is there a way to avoid the render dissapearing when its far without using Config.maxPolysVisible.
Nada por ahora

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Error: out of memory
« Reply #19 on: April 07, 2006, 03:32:21 pm »
No, but may i ask which value you've assigned to Config.maxPolysVisible? I can't imagine a value that causes an out of memory and that is still reasonable to be managed by the engine. If you are using multiple worlds, you can give Config.shareVisibilityList a try, but be aware that this isn't always possible.

Offline manumoi

  • long
  • ***
  • Posts: 121
    • View Profile
    • http://www.iro.umontreal.ca/~blanchae
Error: out of memory
« Reply #20 on: April 07, 2006, 04:25:09 pm »
Hello Mellsj
here is what i do to avoid rendering every polygons in my scene, I put the fog  at a distance smaller than the farPlane value,
My maxPolysVisible is 50000 and it works just fine. But as Egon said, i m surprised that your problem comes from this point

Code: [Select]

private void setupFog(){
        theWorld.setFogging(World.FOGGING_ENABLED);
        theWorld.setFogParameters(1000,0, 0, 0);
        Config.farPlane = 1020;
    }

Offline Melssj5

  • double
  • *****
  • Posts: 715
    • View Profile
Error: out of memory
« Reply #21 on: April 08, 2006, 06:16:55 pm »
I used a very high value, because I tried to use "real size", I mean in relative units, so the crafts are large and the maps are huge, I better use a scale  on all of them.
Nada por ahora