Too slow and too big memory size

This library is too slow. And It needs too big memory size isn.t it?

How can I control memory?

Mikael Aronsson's picture

Hi !

I do not think it is slow, as long as you have enough memory to run it.

And yes it is big, for two reasons.

1. It contains a lot of code and there are lots of cross links between the classes so when you use one class, lots of things from other classes get linked to your app to.

2. Open Cascade use a LOT of templates and this makes the application bigger, meny times duplicate code is generated and all kinds of strange things, templates is a messy thing and most C++ compilers have problems with this.

Take a look at any other library that makes extensive use of templates and you will find the same thing.

As far I have noticed and ordinary application ends up using around 32 megs in Windows and a bit more on Linux, MSVC have better template compilation I guess.

Mikael

Msaaf Omar's picture

Hello,

I think you may be using all the libraries in the link options. may be you could call only the libraries you need.

What you can check is to avoid including classes you don't need...

This may help. As well as having 128 Megs of RAM and a good Flying Processor.

I agree with you that it is big, BUT it does what it was designed for : Mainly CAD with a good geometrical modeler. I am not good enough in C++ to say if it is optimized. And it is so big that I am not sur if Matra guys would be able to answer you.....

Regards Omar Msaaf

Mikael Aronsson's picture

Hi !

> I think you may be using all the libraries
> in the link options. may be you could call
> only the libraries you need.

Well the problem is that there are lots of crossreferences between the libraries, one good example if the GeomAlgo library, if you link to this you also have to link with all the AIS/viewing code even if you don't use it.

I have an application that does not use any part of the AIS code (I do all the rendering on my own), but the memory footprint is the same as when I used AIS (32MB).

I think it would be nice to be able to only link with the libraries you need, but as it is at the moment this is not possible.

> What you can check is to avoid including
> classes you don't need...

> This may help. As well as having 128 Megs of
> RAM and a good Flying Processor.

Yes, I have 256MB and 2 CPUs, that's even better :o)

> I agree with you that it is big, BUT it does
> what it was designed for : Mainly CAD with a
> good geometrical modeler. I am not good
> enough in C++ to say if it is optimized. And
> it is so big that I am not sur if Matra guys
> would be able to answer you.....

As I said with all the templates you will end up with big libraries, even though I do think you could cut down the size of the code if you would use static libraries instead of shared libraries, then only the things need could be linked.

> Regards Omar Msaaf

Mikael

Philippe Poncot's picture

> Well the problem is that there are lots of
> crossreferences between the libraries, one
> good example if the GeomAlgo library, if you
> link to this you also have to link with all
> the AIS/viewing code even if you don't use
> it.

I'm surprise . If you have link with GeomAlgo ( TKgeomAlgo ?? ) , do you need AIS ? Why ??

I think it is not the case . But if there is, I want to know why : if there is unresolved symbols ... If there is really a dependance from TKGeomAlgo to AIS , it is a bug and it should be corrected.

Please give the information about this

Thanks a lot

Mikael Aronsson's picture

Hi !

> I'm surprise . If you have link with
> GeomAlgo ( TKgeomAlgo ?? ) , do you need AIS
> ? Why ??

I need to link to TKV3d at least, (on Windows) or else I get unresolved externals about "Graphic3d_SequenceOfAddress". And I do not have any viewer or view stuff in my application.

This does not happen on Linux, but I do this is related to my next question about templates "Template question".

> I think it is not the case . But if there
> is, I want to know why : if there is
> unresolved symbols ... If there is really a
> dependance from TKGeomAlgo to AIS , it is a
> bug and it should be corrected.

> Please give the information about this

I removed TKV2d and TKV3d from my application on Linux and had no problem to do that so it's a windows problem.

> Thanks a lot

Mikael Aronsson's picture

Hi again !

This is a list of all the dll's that are loaded when I start my application (on Windows) and this application does NOT use any Viewer or View class what so ever (and no AIS slasses either).

Interesting tosee, also TKHLR is also loaded, I guess this is the Hidden Line Removeal stuff, and this is also not used in any way in my application.

TKPrim.dll KBRep.dll TKGeomBase.dll TKernel.dll Rtk.dll TKMath.dll TKG2d.dll TKG3d.dll TKTopAlgo.dll TKGeomAlgo.dll TKV3d.dll TKV2d.dll TKService.dll TKHLR.dll TKBool.dll

Mikael

Philippe Poncot's picture

I think there is something in your application which require this symbol ( Graphic3d_.. ) . I have verify with a QuickView on the TKGeomAlgo.dll and there is no dependencies with Graphic ( in 3.0 and 4.0 DEV )

About HLR , this library is required by TKV3d.

To find where is this dependency , you can use the "dependency walker" programs depends.exe.

Philippe

Mikael Aronsson's picture

> I think there is something in your
> application which require this symbol (
> Graphic3d_.. ) . I have verify with a
> QuickView on the TKGeomAlgo.dll and there is
> no dependencies with Graphic ( in 3.0 and
> 4.0 DEV )

Maybe you are right, I will take a look and see if I can find the reason.