>>>>> On Mon, 17 Jul 2006 10:11:10 -0700, "Fong Tsui" <[EMAIL PROTECTED]> said:
Fong> OK. The problem seems that netsnmp_create_subtree_cache() malloc
Fong> memory for SNMP_MSG_GETBULK (in agent/snmp_agent.c) for each
Fong> session. If there are multiple sessions in process, the memory
Fong> will be a huge amount. There is no limit.
I'm glad you've narrowed it down to a particular place. That
certainly helps us to discuss it.
However, there aren't many choices about what can be done. To put it
simply there are two choices:
1) limit the maximum number of varbinds that can be responded to
(could be done algorithmically based on expended packet response size)
2) don't
In short, the results of the requests have to be stored before they
can be returned to the request or, so you don't really have a choice
about allocating the memory or not. The best you could do would be to
compress it somehow instead (encoding each result as it came back
would be one way to do this, and is indeed what the original CMU agent
did but there were different issues with that approach as well).
And if multiple sessions are available (possibly to a sub-agent, etc)
and are getting acted on at once then you're right that multiple
mallocs could occur. This also leads to only two (different) choices:
A) Handle multiple requests at once to attempt to be efficient and
deal with multiple management requests arriving at once.
B) don't and only process requests serially
Right now #1 and #A are both the choices in place. I'd argue that we
should offer a run-time configuration setting to allow at least #B to
be chosen if desired (and there may be one, I don't remember and
haven't looked). Choice #2 certainly isn't there today and maybe
should be...
--
Wes Hardaker
Sparta, Inc.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders