Hi,
Each frame allows you to configure the Nr. of objects.
If i set it to 100, and i make 200, only 100 apear.
What if i just set it to the MAX.
And why isn't it on MAX by default?
Whats the point?



Hi,
Each frame allows you to configure the Nr. of objects.
If i set it to 100, and i make 200, only 100 apear.
What if i just set it to the MAX.
And why isn't it on MAX by default?
Whats the point?










Memory. The higher the max value is, the more memory it will allocate for use. So if you have alot going on, the application might be faster if you reduce the value.





The higher you set this, the more system resource your application will require to run. It's set at a nice round number and can easily be up-ed if need be.
KnightTrek Productions
http://www.knighttrek.com


Umm.. no, it doesn't preallocate the memory as far as I know.







I think it is... If not, I don't understand why there is a maximum number (20000).


It doesn't- try running the application with the max limit set to 50 and then changing it to 20000 and running it again. Same amount of memory.
I was only looking at the MMF2 debugger, so it could be that it did take up more memory but less than a MB- in that case, it wouldn't matter if the limit was set to 20000 by default anyway.
I think it is set low by default as a safety measure so that you can't create enough objects to make things grind to a halt.
Thats what I think too, one wrong thing and your object count goes up at runtime and there goes the memory.Originally Posted by Jam
Would love to see a small pop up on the debugger letting me know I reached my object limit, then this would be quite useful and I would not just set the limit to 5k from the beginning.

The memory that is permanently reserved for all objects is on the order of 8 bytes each. So 200 objects is 1.6kB, and 20000 objects is 160kB.
When an object is created into a slot, the memory needed for the instance is requested, and referenced in those 8 bytes. The memory for an object instance is on the order of 1.1kB each (including 416 bytes for alt. values). So 20000 created objects is about 22MB.
It's possible that in an earlier version of the runtime (TGF or KnP), the memory for object instances was pre-reserved, so a 20000 object limit would result in 22MB in use, instead of 20000 currently created objects. This would likely have been before extensions, when the size of the largest object instance was known.