Have the OOM handler also count the age the data in a stream buffer
Count freed buffer bytes from buffers when oom-killing circuits.

Also, aggressively clear the buffers to try to make their bytes go
away fast rather than waiting for the close-marked-connection code
to get 'em.
doxygen comments for 10169 code
Changess file for #10169
Rename MaxMemInCellQueues to MaxMemInQueues
Drop the MaxMemInQueues lower limit down to 256 MB.

on #9686, gmorehose reports that the 500 MB lower limit is too high
for raspberry pi users.
Merge remote-tracking branch 'public/bug10169_023' into bug10169_024

Conflicts:
	doc/tor.1.txt
	src/or/config.c
	src/or/or.h

The conflicts were all pretty trivial.
Fix bugs in bug10169 bugfix memory tracking

The chunk_grow() and chunk_copy() functions weren't adjusting the
memory totals properly.

Bugfix not on any released Tor version.
Actually release buffer freelists when handling OOM conditions.

Otherwise freeing buffers won't help for a little while.
Merge remote-tracking branch 'public/bug10169_023' into bug10169_024
Merge remote-tracking branch 'public/bug10169_024' into bug10169_025_v2

Conflicts:
	src/or/circuitlist.c
Debugging code inbuffers.c for debugging chunk allocation.

Currently on; will disable later in this branch.
Start writing tests for 10169.

Now we cover more chunk allocation functions.
Several tests for buffer allocation
Add tests for buffer time tracking.
Refactor OOM-handling functions for more testability

This patch splits out some of the functions in OOM handling so that
it's easier to check them without involving the rest of Tor or
requiring that the circuits be "wired up".
Initial unit tests for OOM handling
More unit tests for OOM handling.

This gets us up to no interesting untested new or changed lines for
the 10169 code.
On OOM, also log N circuits remaining
Monotonize the OOM-killer data timers

In a couple of places, to implement the OOM-circuit-killer defense
against sniper attacks, we have counters to remember the age of
cells or data chunks.  These timers were based on wall clock time,
which can move backwards, thus giving roll-over results for our age
calculation.  This commit creates a low-budget monotonic time, based
on ratcheting gettimeofday(), so that even in the event of a time
rollback, we don't do anything _really_ stupid.

A future version of Tor should update this function to do something
even less stupid here, like employ clock_gettime() or its kin.