Re: netstat: sysctl: net.route.0.0.dump.0: Cannot allocate memory

From: Hiroki Sato <hrs_at_FreeBSD.org>
Date: Mon, 24 Feb 2014 13:09:24 +0900 (JST)
Ian FREISLICH <ianf_at_clue.co.za> wrote
  in <E1WGmTE-0000nr-Us_at_clue.co.za>:

ia> Hiroki Sato wrote:
ia> >  Hm, how about the attached one?
ia> >
ia> >  I think the cause is just a race when length of the sysctl's output
ia> >  is changed in kernel after the buffer allocation in userspace, not
ia> >  memory shortage.  Size of the routing table can quickly change.
ia>
ia> You are correct.  It's growing at about 9000 entries per second (I
ia> wish it were faster).
ia>
ia> This is what the output looks like now.  I guess I'm not the average
ia> case.

 Can you try the attached patch?  It will attempt to enlarge the
 buffer every retry.

-- Hiroki

Received on Mon Feb 24 2014 - 03:10:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:47 UTC