users@grizzly.java.net

Re: Grizzly slowly leaking with comet support on version 1.0.39

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Mon, 11 Apr 2011 15:26:50 +0200

Hi William,

> I am observing a memory leak in grizzly comet support (1.0.39). After a few
> days of use, I have seen the memory growing slowly by looking gc logs....
> Multiple full gc did not clear the memory. Memory groes of 200Mo a day avg.
>
> I have performed an heam dump with jmap (3go) and analyze it with a tool. It
> seems that the collection named 'bannedKeys" contains in SelectorThread is
> always growing. I think I can provide you a report bit not the entire heap
> dump (too large I think).
>
> Did anyone observe the same behavior ?
Can you pls. file an issue on issuetracker? [1]

Also wanted to ask for more details...
Are you using HTTP pipelining together with comet? Are you reading off
all the input before registering a comet handler?

We can definitely fix the memory leak and start using WeakHashMap for
the bannedKeys collection, but just wanted to make sure we're not
missing anything else.

Thanks.

WBR,
Alexey.

[1] http://java.net/jira/browse/GRIZZLY