#3 OutOfMemory under heavy load

open
nobody
None
5
2006-09-20
2006-09-20
Anonymous
No

Under heay inform/trap load on a system that is
hevily loaded SnmpPortal allocates too much memory
and ultimately causes OutOfMemoryError and the death
of the Reciever thread. This happens because there is
no limitation on the size of the fastReceiverQ.

Suggested solution below. It would be preferable if
the limit of the queue (1000 below) would be
configurable by the client code or a system property.

synchronized(fastReceiverQ)
{
fastReceiverQ.addLast(pkt);

if (fastReceiverQ.size() == 1) {
fastReceiverQ.notify();
} else if (fastReceiverQ.size() > 1000) {
//Remove the oldest pkt in the queue.
fastReceiverQ.removeFirst();
//TODO: log this.
}
...

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks