netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Adding element to interval map consumes entire memory
@ 2016-12-11 14:20 Richard Mörbitz
  2016-12-11 19:28 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Mörbitz @ 2016-12-11 14:20 UTC (permalink / raw)
  To: netfilter-devel

Hello,

first of all: the build in use is the current master
(c89a0801d07740eff531412fe35ea2c9faad82b0).

We have a test setup running which consists of one table ("nat2") and an
interval mapping ("subnettoip") of the type ipv4_addr -> ipv4_addr. The
mapping is quite large (~16000 elements). One requirement of the system
is that elements can be added and deleted during runtime.

With that map constructed, adding a new element is not possible. NFT
will terminate during reallocation, because no memory is left.

GDB trace:
http://pastebin.com/s7eyNEsH

Valgrind leak check:
http://pastebin.com/fkG5UQig

Note that the test machine only has 2 GB of RAM, 1.6 of which are
consumed by nft. So one question is: is it even possible to have enough
memory in the final system, such that the required operation can be
performed?

The second question would be: why is it necessary to allocate that much
memory? As I have found out by reading the code, all map elemtents are
cached before performing the operation; they are even sorted. Is that
really necessary for operations like adding map entries?

Kind regards
Richard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-15 22:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-11 14:20 Adding element to interval map consumes entire memory Richard Mörbitz
2016-12-11 19:28 ` Pablo Neira Ayuso
     [not found]   ` <3acabb81-c5b5-2004-18ce-8b5242f07921@tu-dresden.de>
2016-12-13  0:48     ` Pablo Neira Ayuso
2016-12-14 23:52       ` Richard Mörbitz
2016-12-15 22:02         ` Pablo Neira Ayuso
2016-12-15 22:47           ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).