Hello Vladimir,

Vladimir Galouchko wrote:
> I took 02move.cpp test from Tutorials and insert 2 command only in display() 
> function.
> Half hour test run increased used memory from 29 MB to 50 MB. Why? I use v. 
> 1.6  VS 2003 Debug mode.
> #include <OpenSG/OSGPolygonForeground.h>
> 
> PolygonForegroundPtr pg = PolygonForeground::create();
> 
> subRefCP(pg);

each of the create calls appends an element to a std::vector in 
FieldContainerFactory. This is used for various things and allows one to 
retrieve a container when only its id is known. In cases where huge 
numbers of objects are created this can result in a significant increase 
in memory use. AFAIK there have been only very few problems with this 
(in real world applications), but it would be possible to choose another 
memory/performance tradeoff inside the factory.
It is generally better to reuse objects where possible, especially since 
object creation is not really a lightweight operation.

        Hope it helps,
                Carsten

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to