Author Topic: Memory consumption with Config.maxPolysVisible  (Read 422 times)

Offline Jamiro

  • byte
  • *
  • Posts: 19
    • View Profile
Memory consumption with Config.maxPolysVisible
« on: January 16, 2018, 04:20:20 am »
Hello,

I've come to the conclusion that using Config.maxPolysVisible can use too much memory.
I've searched for options to ingore this property but I don't think there is any.

Is there any possibility to discard this validation thus using only a small Visibility List which would take up fewer memory usage?

PS: Curently I'm using a value like 1000000, but I would need to use more since it is a single enclosed scene, my hardware could take more but not the Heap memory, which is already maxed.

regards,
Jamiro

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11853
    • View Profile
    • http://www.jpct.net
Re: Memory consumption with Config.maxPolysVisible
« Reply #1 on: January 16, 2018, 08:02:19 am »
Then just increase the heap memory, or isn't that an option? Or consider to use compiled objects http://www.jpct.net/wiki/index.php?title=Compiled_objects, which will use much less space in that particular list.

Offline Jamiro

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Memory consumption with Config.maxPolysVisible
« Reply #2 on: January 16, 2018, 04:30:34 pm »
Well, memory is maxed up already, and I'm already using compiled objects, as well as not using mipmaps, already using 16-bit texture and so on.... all efforts for minimal memory usage were done, but still if I want to give just another zero to the max polygon visibile, it will just give me too much memory consumption followed by the memory heap space problem.

it seems that it can reach 1500+ MB memory usage.

is there any possibility to bypass this visibility list, and take the responsability on my own? It would be awesome if it would.

Regards

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11853
    • View Profile
    • http://www.jpct.net
Re: Memory consumption with Config.maxPolysVisible
« Reply #3 on: January 16, 2018, 05:28:53 pm »
No, but that list actually isn't that expensive. I'm really wondering where all your memory is gone!? Are you using very large textures or something like that.

Offline Jamiro

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Memory consumption with Config.maxPolysVisible
« Reply #4 on: January 16, 2018, 05:54:47 pm »
No, ATM just only one big object with 262.144 polygons, and only 1 texture, not mipmapped with 16 bits (but even that won't make any difference being only 1 so far).

the problem is that I'm running on a 32-bit vm system, and can only get 1500 MB of memory to the max.

I could switch to a 64-bit but this project was trying to be compatible due to its specs.

Results:

Config.maxPolysVisible = 100000;  -> yields Memory Used: 367MB
Config.maxPolysVisible = 1000000; -> yields Memory Used: 721MB
Config.maxPolysVisible = 10000000; -> java.lang.OutOfMemoryError: Java heap space

using xms = 1200 MB and xmx = 1200 MB

so I can assume that each zero will boost up exponentially, which was the issue with the memory. So far it's not a problem, but later on it will be when I need more textures and non-vbo objects (they are this way so that I can work with vertices and texture maps in real time). S I was getting a bit scared. But seeing there is no possibility to ingore this property checking, I don't know what to do to.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11853
    • View Profile
    • http://www.jpct.net
Re: Memory consumption with Config.maxPolysVisible
« Reply #5 on: January 17, 2018, 08:05:00 am »
Still, I don't see why you need such a large list. Not all polygons will be visible at once, or will they?

Offline Jamiro

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Memory consumption with Config.maxPolysVisible
« Reply #6 on: January 17, 2018, 09:36:57 pm »
They mostly will because it's a single enclosed object seen from above, like an heighmap mesh, so some of them are being discarded by the validation.

I've tried to boost up to 10 M polys but is just gives me a usage of almost 3 GB of mem.

but thanks anyway, I will try to work it around I guess.

Regards.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11853
    • View Profile
    • http://www.jpct.net
Re: Memory consumption with Config.maxPolysVisible
« Reply #7 on: January 18, 2018, 11:01:17 am »
But each compiled object only consumes as much entries in that list as is has sub-parts, which usually are only a few. I really don't understand why you need such a large list...!?

Offline Jamiro

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Memory consumption with Config.maxPolysVisible
« Reply #8 on: January 18, 2018, 12:01:03 pm »
Ok, so perhaps I understood this wrongly:

using this:
Config.maxPolysVisible = 100000;

allows me to render a compiled object with 2.106.598 polygons, yielding only a visibile group of around 5.000.

I thought that this list was the same for uncompiled objects. The thing was that this object ineeded to be uncompiled due to the need for changing vertex and uv data at runtime, and I was also using the DrawWireframe feature that doensn't work with compiled objects as well.

PS: So when using compiled objects, how can I know the limit for them, which limit should I use (is there any ratio)? Or they aren't even validated by that property?

Regards and thank you
« Last Edit: January 18, 2018, 12:23:54 pm by Jamiro »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11853
    • View Profile
    • http://www.jpct.net
Re: Memory consumption with Config.maxPolysVisible
« Reply #9 on: January 18, 2018, 01:16:35 pm »
It depends. compile() on an object will print out the number of sub-objects that are being used. That's the maximum number of entries that the object can use in the list.

Offline Jamiro

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Memory consumption with Config.maxPolysVisible
« Reply #10 on: January 18, 2018, 06:04:35 pm »
Great, thanks