[wxPython-users] Can you limit CPU resources for the running app ?
Chris Mellon
arkanes at gmail.com
Thu Jan 17 05:30:08 PST 2008
On Jan 16, 2008 5:22 PM, Christopher Barker <Chris.Barker at noaa.gov> wrote:
> Geoff Skerrett wrote:
> > I have a wx app that does some image processing. Occasionally a user
> > will select a large number of images (100+) and it can take 30-40mins to
> > complete the process. All of the users are WindowsXP.
>
> This is an XP problem -- if one app can bring the system to a halt, then
> the OS isn't handling that well. I don't know Windows well, but there
> probably is a way to change how many resources a given app can use --
> it's a system thing, though, not a wx thing. ON Linux, you'd look for
> "nice" and "ulimit".
>
> XP isn't that bad usually, though, so I suspect that maybe your issue
> here is memory use, not CPU use. Perhaps you could re-structure the app
> somewhat to reduce memory use?
>
> > I have little experience with threading, but was wondering if this would
> > solve the problem.
>
> nope. threading is a way to divide work in one process -- you're dealing
> with conflicts between processes here -- the OS needs to deal with that.
>
> Have you looked to see how much memory and CPU your app is using? that
> should give you a hint as to where to focus your efforts.
>
The description and the problem are consistent with XPs behavior when
a process uses gobs and gobs of memory, sending XP into a terrible
swapping-loop. It can be extremely frustrating, and renders the
workstation nearly useless - you can't interact with it even enough to
kill the offending process.
I don't believe that changing CPU priority will help with this, and I
don't believe that XP has any mechanisms to enforce a memory cap
(unlike ulimit). Your best bet is to try to handle it in the
application by limiting the amount of jobs you run simultaneously.
More information about the wxpython-users
mailing list