Memory consumption with Config.maxPolysVisible

Started by Jamiro, January 16, 2018, 04:20:20 AM

Previous topic - Next topic

Jamiro

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

EgonOlsen

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.

Jamiro

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

EgonOlsen

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.

Jamiro

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.

EgonOlsen

Still, I don't see why you need such a large list. Not all polygons will be visible at once, or will they?

Jamiro

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.

EgonOlsen

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...!?

Jamiro

#8
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

EgonOlsen

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.