memory usage and custom compilation

Our team is planning on shipping a fairly large sized wxPython application in
the not-too-distant future, and one issue that we've kept off of our radar so
far is the relatively high memory usage we see in an app that doesn't do too
much memory intensive work.

In Windows, at least, at the app's startup the Task Manager shows something like
a 40 megabyte initial load, which is not so high as to be unreleasable, but
definitely enough to be bothersome.

Admittedly, the following code in a python terminal...

import wx
app = wx.PySimpleApp()
f = wx.Frame(None, -1, 'Test Frame')
f.Show()
app.MainLoop()

Shows python.exe with memory usage at 20,212K. So while that tells me that a
lot of our code is a little too greedy (the skinning system could probably use a
closer look), the wxPython runtime itself isn't exactly lightweight.

My question, finally, is: has anyone done custom compilation of wxPython, taking
out big chunks like Media, STC, XRC, XML, Net, and the DB stuff (all of which we
make no use of) and measured the difference in (startup) memory usage? I'm not
entirely knowledgeable in the how the modularity of wx works, but I do know that
all of the mentioned "sub" frameworks get their own DLLs, and that that might
mean that their native code segments (?) are only loaded when needed. But does
the same go for the SWIG bindings to that code?

Is there a substantial benefit in my team looking into compiling a custom
wxPython on Windows so we can strip it down to just what we need?

Kevin Watters wrote:

My question, finally, is: has anyone done custom compilation of wxPython, taking
out big chunks like Media, STC, XRC, XML, Net, and the DB stuff (all of which we
make no use of) and measured the difference in (startup) memory usage? I'm not
entirely knowledgeable in the how the modularity of wx works, but I do know that
all of the mentioned "sub" frameworks get their own DLLs, and that that might
mean that their native code segments (?) are only loaded when needed. But does
the same go for the SWIG bindings to that code?

If you don't import wx.media, wx.stc, wx.xrc modules then you won't be loading that code. The wx XML code is used by the wx.xrc module, and Net is used by wx.html, and the DB code is already disabled by default.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

If you don't import wx.media, wx.stc, wx.xrc modules then you won't be loading that code. The wx XML code is used by the wx.xrc module, and Net is used by wx.html, and the DB code is already disabled by default.

Darn.

I'm hoping to get wxPython working on the Nokia 770, which is pretty memory limited (64mb). I was hoping it would be possible to trim down memory usage a fair bit by not using some of those modules.

Do you think it's as small as can be?

What about removing wxGrid, maybe wxHtml, or other "large" classes that might not be used by a given app?

Is there hope? or should I just give up and buy the new Nokia n800, which at least has 128mb?

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Kevin,

Robin's reply was discouraging, but if you do find a way to reduce memory usage -- please post it on this list. It has come up a fair bit in the past, but I think most people have found it easier to increase the hardware requirements than really try to modularize the code enough to reduce the footprint substantially.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Christopher Barker wrote:

Do you think it's as small as can be?

There is probably be something that can be done, I've just been looking at the forest for so long it's kinda hard to see the trees. :wink: A fresh set of eyes and hands working on the problem could help.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!