<div dir="ltr"><div>Thanks, all! I think I have enough to move forwards, on a Linux box at least.<br><br>As as for psutil: I'll look at that again in the future if I need to move to other OSs.<br><br></div>--Paul Hoffman<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 19, 2015 at 12:32 PM, Minesh Patel <span dir="ltr"><<a href="mailto:minesh@gmail.com" target="_blank">minesh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Along the same lines as Bill mentioned:<div><br></div><div>proc_data = = open('/proc/%s/status' % os.getpid()).read()</div><div><br></div><div>should work</div><div><br></div><div>Cheers,</div><div>Minesh</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Feb 19, 2015 at 12:02 PM, Paul Hoffman <span dir="ltr"><<a href="mailto:paul.hoffman@gmail.com" target="_blank">paul.hoffman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>This could be a good shot, but I'm not sure how to use it to get the current amount of memory used by the Python program. If I do a subprocess.getoutput("cat /proc/sefl/status"), is shows the amount of memory used for "cat", not for the enclosing program.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">--Paul Hoffman<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 19, 2015 at 9:27 AM, William Deegan <span dir="ltr"><<a href="mailto:bdbaddog@gmail.com" target="_blank">bdbaddog@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Paul,<div><br></div><div>If you only care about linux you can parse /proc/self/status</div><div><br></div><div>-Bill</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Feb 19, 2015 at 8:08 AM, Paul Hoffman <span dir="ltr"><<a href="mailto:paul.hoffman@gmail.com" target="_blank">paul.hoffman@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Greetings. I have a Python 3.4 program that will keep eating up memory until I tell it to stop; in short, it uses asyncio to launch as many coroutines as the machine can handle. I want to determine approximately how much memory I am using at this moment so I know when to stop consuming more and having the box run out of memory (I already have swapping turned off).<br><br></div><div>Are there well-known patterns for this? I looked in a bunch of places and found nothing, which kinda surprised me. I recognize that it is unlikely that there is a cross-OS method for this, but I would be happy with just something that says "I'm now taking up a total of 3.7 gig" and I can do the "how much is too much" calculation by hand.<br><br>Pointers are appreciated.<span><font color="#888888"><br><br></font></span></div><span><font color="#888888"><div>--Paul Hoffman<br></div></font></span></div>
<br></div></div><span>_______________________________________________<br>
Baypiggies mailing list<br>
<a href="mailto:Baypiggies@python.org" target="_blank">Baypiggies@python.org</a><br>
To change your subscription options or unsubscribe:<br>
<a href="https://mail.python.org/mailman/listinfo/baypiggies" target="_blank">https://mail.python.org/mailman/listinfo/baypiggies</a><br></span></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Baypiggies mailing list<br>
<a href="mailto:Baypiggies@python.org" target="_blank">Baypiggies@python.org</a><br>
To change your subscription options or unsubscribe:<br>
<a href="https://mail.python.org/mailman/listinfo/baypiggies" target="_blank">https://mail.python.org/mailman/listinfo/baypiggies</a><br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div>Thanks,<br>--Minesh</div>
</font></span></div>
</blockquote></div><br></div>