Re: Python threading



On Mar 8, 6:15 pm, "Gabriel Genellina" <gagsl-...@xxxxxxxxxxxx> wrote:
En Thu, 08 Mar 2007 14:25:02 -0300, <test...@xxxxxxxxx> escribió:
All threads share the same memory space, there is not a "per-thread"
memory allocator, if that's what you are thinking.
Perhaps you hold a reference to some objects in the Thread object? Or you
still keep the Thread object itself?

That is what I was thinking. A per-thread memory allocator of some
sort. What I need is run a lot of commands from a COM object that can
be run independently. There commands leak memory, so when the command
finishes, the memory consumption jumps to 800MBs or so. Which begs the
question, if I initialize the COM object in a separate thread and run
the command, does finishing the thread clean up any and all memory the
thread used or not. The output of each thread would actually be a file
on disk, therefore there is no need to pass any data between the
threads and the main program.

I did try the pythoncom.CoUnitialize() to release memory, but it
doesn't seem to work (it does work about 30-45 seconds after the
command is run).

I don't understand what you say here.
What means "it doesn't seem to work" and "it does work 30 seconds after"?

pythoncom.CoUninitialize(), if I am not mistaken, releases a COM
object (and therefore the memory it uses I assume). When the command
is run (in PythonWin for example), the memory is not released but
persists for quite a while. Using my watch and the Task Manager in
Windows I can see that the memory is released approximately 30 seconds
AFTER I run the pythoncom.CoUninitialize() command is run.

What memory do you want to release "right away"?

The memory I want to release is the memory the COM object used (the
one initialized with the win32com Dispatch command). The "right-away"
is not much of an issue, but if I can release it before I run each
command from the COM object that leaks memory, it would be nice.
Running upwards to 800MBs of RAM for one 500 line python script seems
a little bit too much for me.

Thank you for your reply Gabriel. If you have any more input, I would
greatly appreciate it.


.



Relevant Pages

  • Re: avoiding glTranslatef*
    ... that "vertex" would be a internal hardware-level command. ... The modern 3D chip has hundreds of ALU's and a _LOT_ of processing ... What they need is more memory bandwidth, ...
    (comp.graphics.api.opengl)
  • Re: Isnt Command Rate a "memory setting?"
    ... If I set the command rate to 2T, ... spec for your memory says 2.75v. ... is telling me that it's NOT a memory setting. ... PSU problems are not out of ...
    (alt.comp.periphs.mainboard.asus)
  • Re: open command failing on serial port
    ... >>I tried changing the pci slot, it gets assigned the same base ... Command: 0x0106 Memory Enabled, I/O Disabled ... AGP Status: 0x00000200 ...
    (comp.unix.sco.misc)
  • 2924 XL: Insufficient memory when booting
    ... The "version" command showed it had 8 meg of memory. ... This switch is to replace the one partially damaged by lightning. ... The TAR command when expanding the html files due to lack of space. ...
    (comp.dcom.sys.cisco)
  • Re: Append to char *
    ... > That's a pretty good way to make demons fly out your nose, ... invokes undefined behavior. ... command similarly points to 8 bytes of memory. ...
    (comp.lang.c)