Hi,

The following message was posted some time ago, but it seems quite
surprising to me!... =)

Does it mean that I should avoid creating and erasing FieldContainers
repeatedly? If somehow, my algorithms end up creating and erasing FC's (let
say.. every frame), am I going on memory leak?

Is this the expected behaviour for version 1.8 and 2.0 of OpenSG?

Is there another way to overcome this issue? Like cleaning the changelist
once in a while?

Its not clear to me, why the FieldContainerFactory should be aware of every
FieldContainer instance of the program. Could somebody clarify that to me?
=)

Thanks in advance,
Olavo.


On 2/25/07, Carsten Neumann <[EMAIL PROTECTED]> wrote:

       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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to