Memory usage

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

zhk_tiger
Just popping in
Just popping in
Posts: 3
Joined: Wed Jun 14, 2006 14:41

Memory usage

Postby zhk_tiger » Sat Mar 03, 2007 14:09

I found some frequently used widgets are realized not cheap, such as StaticText. It owns two scrollbars, a scrollbar owns three PushButtons.

The following table shows the memory grows up during a StaticText creating: (Unit:KB)

Code: Select all

      Mem Usage   VM Size   Total   Cost
      18772      14828   33600   
StaticText
self created   18812      14868   33680   80

Children ScrollBars
created      19168      15224   34392   712


So you can see the ScrollBars cost 712KB. Most time we only need a simple text widget, like a Caption(with Font and Color properties), we need not the ScrollBars.

And for a Game GUI, there will be likely up to 100 Caption widgets(without scrollbars) needed, if we use the current StaticText, we wasted 712KB*100 = 71.2MB memory.

So I strongly suggest it is better to add a cheap Caption widget. And for other widget realization, it is also better when the realization is cheep.

Regards,
zhk_tiger

mrp
Just popping in
Just popping in
Posts: 10
Joined: Thu Jan 11, 2007 13:08

Postby mrp » Mon Mar 19, 2007 14:49

I'm findind similar memory implications of using CEGUI. Was using Ogre 0.15.2 with old CEGUI and then moved to 0.4.1 on 1.2.5 Ogre, and everything has ballooned. I have a number of screens with tables drawn with staticText boxes and these screens are HUGE in memory - having to rewrite a mammoth chunk of code to try and get this down!!

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Mon Mar 19, 2007 21:47

If you already move to a "new" CEGUI version, wouldn't it be better to move to 0.5.0 ?

mrp
Just popping in
Just popping in
Posts: 10
Joined: Thu Jan 11, 2007 13:08

Postby mrp » Tue Mar 20, 2007 09:29

Very good point - yes I agree, I should, but I am concerned that I have a screen with lots of statictext boxes on and its over 70Mb in size - I create all my GUI screens at boot time at the moment, and so I've changed that to dynamic creation - but then I suffer with another problem that I've posted about elsewhere where it takes longer and longer each time the screen is created. I also don't seem to free up any space when destroying the GUI and subsequently cleaning the dead pool!

Maybe 0.5.0 will fix all these issues.

zhk_tiger
Just popping in
Just popping in
Posts: 3
Joined: Wed Jun 14, 2006 14:41

Postby zhk_tiger » Thu Mar 22, 2007 07:07

I have added a Caption widget(no scroolbars, has Text, Font, TextColor, Alignments) to the CEGUI project we are using(V0.4.1), the memory usage has decreased greatly. Also the creation time is greatly saved.

StaticText in CEGUI 0.5 still has scroolbars, so i do not think the memory usage will be much better.

mrp
Just popping in
Just popping in
Posts: 10
Joined: Thu Jan 11, 2007 13:08

Postby mrp » Thu Mar 22, 2007 11:29

@zhk_tiger: any chance of supplying some code for your caption widget? would be a great help ;)

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Thu Mar 22, 2007 17:56

The first thing I've done in my CEGUI projects is create a simple Label looknfeel for DefaultWindow that acts as a static text without scrollbars.

Dont know why we dont have this in the default skins.

I wont mind adding this. And suggest the name <Skin>/Label

But it wont be for 0.4 as that would require code changes as well.

mrp
Just popping in
Just popping in
Posts: 10
Joined: Thu Jan 11, 2007 13:08

Postby mrp » Fri Mar 23, 2007 09:23

lindquist that would be great! I will take steps over the coming week to move to 0.5 and then I can implement this.

Cheers


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 20 guests