Howto increase maximum displayed objects

Hey guys,

after implementing our solar system with everything, i attempted the displaying of the oort cloud, which in reality has ~ 1trillion objects, which obviously can not be created due to insuffient memory. So i tested with around 1500 objects wich works just fine (~4GB RAM allocated) but increasing after this point is at the moment not possible. Any thoughts on how to increase the amount of objects that can be displayed?? Or in other words, is there any possibility to just use less memory for each object??

(java tags do not work properly with my code, deleting out most of it :confused: dunno why…)

EDIT: http://pastebin.com/sFHdyGe4 for the code

regards,
Ben

ok, decreasing the sample size of the oortObjects helped a bit, any other thoughts?

What memory are you running out of?
Maybe your graphics card is giving up?

1500 objects is not much (provided they are simple of course).

EDIT:
You’re creating 1500 Spheres 10000 polys each (if I’m counting correctly). That’s a lot. Start using point sprites, you’ll be able to display much more.

OutOfMemoryError: Direct buffer memory

i’d say a GTX 560 should be able to handle this, so as i already said, i decreased the polygons to 9 each, instead of the previous 10000, which is an increase to about 75k objects… but i’ll look into point sprites, thanks for that :slight_smile:

Graphics cards are far better at drawing large meshes instead of many small ones… try batching the geometries to decrease the object count.

1 Like

Direct Memory != graphics card memory. I think the default limit is 256 meg unless you set it higher on the java command line.

yeah i know, as i already said in the initial post, jvm memory is set to 4GB at the moment

@Nor4d said: yeah i know, as i already said in the initial post, jvm memory is set to 4GB at the moment

Which memory? Direct memory or regular heap? You weren’t specific and it critically makes a difference.

ok my bad :wink: -Xms3072 -Xmx4096 as jvm arguments :wink:

EDIT: i recently fiddled with the -XX:MaxDirectMemorySize= command, but it does not increase performance for me

You’ll want to do some level-of-detail stuff.
I.e. generate objects by need, i.e. when somebody’s point of view is close (or narrow-angled) enough so that the object might cover more than half a pixel. Draw a haze for the areas where you haven’t generated objects. That kind of stuff.

@Nor4d said: ok my bad ;) -Xms3072 -Xmx4096 as jvm arguments ;)

EDIT: i recently fiddled with the -XX:MaxDirectMemorySize= command, but it does not increase performance for me

Increating max direct memory was about getting rid of the OOMs… performance will still be pretty bad with lots of objects.