[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Tor takes too much RAM




Here's some docs for you to look over, since you clearly don't know the free command.

http://swoolley.org/man.cgi/1/free
http://rimuhosting.com/howto/memory.jsp (look at "interpreting free".)

Also, running it on a system and comparing the output to /proc/meminfo can be enlightening. I find it gives a good overview of what the system is doing - "top" might say "hey this program is using a lot of memory", but "free" can tell you "this entire system is struggling" on the commandline, which is occasionally much nicer than opening up top. I would have included top output except that I didn't think of posting to the list before doing this, and I suspect that starting tor cleanly would not have demonstrated the memory usage as well.

Essentially, it's telling me that before I killed tor, I had 7m of swapfile and 1.7m of RAM free. Deducting buffers and cache, I had a whopping 10mb of RAM free. After I killed tor, that changed to 43mb of swap and 57mb of main memory free, with 11m used by buffers and cache. Note that the former was after I'd killed apache and mysql in an attempt to have a usable command-line - I imagine it would have looked worse if I hadn't already done that.

So, essentially, tor was eating 90mb or so of RAM at that point. Considering Olaf's hilarious 1.5gb example, I guess I was getting off lightly.

-Ben

Scott Bennett wrote:
     On Fri, 20 Jul 2007 23:39:45 -0700 Ben Wilhelm <zorba-tor@xxxxxxxxxxxxx>
wrote:

# free
             total       used       free     shared    buffers     cached
Mem:         98520      96772       1748          0       2220       5848
-/+ buffers/cache:      88704       9816
Swap:        65528      58480       7048
# killall tor
# free
             total       used       free     shared    buffers     cached
Mem:         98520      41464      57056          0        644      10356
-/+ buffers/cache:      30464      68056
Swap:        65528      22496      43032

I'd love to keep it running, but when it's singlehandedly chewing up more than half of my system's RAM, it just isn't going to happen. Any suggestions on this? Are there config options I can tweak to make it a little less RAM-hungry, or is it just intrinsically a memory gobbler?

     How can you tell that it is?  The display of numbers above doesn't seem to
show the important figure, namely, the working set size for tor.  The rest of
what tor allocates in user space is irrelevant.  Kernel space allocations that
are page-fixed (in slang, "wired [down]") are important, but those that are not
fixed shouldn't usually matter either.  What, for example, does the "used"
column above mean?  Is that the total virtual memory allocated to a particular
process?  To all processes?  Or is it just the page frame memory currently in
use by a particular process?  By all processes?  Even top(1) gives more useful
information than your "free" command.


                                  Scott Bennett, Comm. ASMELG, CFIAG
**********************************************************************
* Internet:       bennett at cs.niu.edu                              *
*--------------------------------------------------------------------*
* "A well regulated and disciplined militia, is at all times a good  *
* objection to the introduction of that bane of all free governments *
* -- a standing army."                                               *
*    -- Gov. John Hancock, New York Journal, 28 January 1790         *
**********************************************************************