roost-im / roost

An experimental new Zephyr client
MIT License
4 stars 2 forks source link

Memory woes #25

Open davidben opened 11 years ago

davidben commented 11 years ago

Maybe we're leaking sockets. Not sure if we are... but it's a little suspicious. Backend thinks I have four sockets open, but I can only find one active Roost session. Shut down sockets if we don't hear from the client for a while?

davidben commented 11 years ago
4499.711 websocket 127.0.0.1:39289 (<redacted>) Mozilla/5.0 (Linux; Android 4.3; Nexus 4 Build/JWR66V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.40 Mobile Safari/537.36

Yeah, uh, I think that socket is leaked.

davidben commented 11 years ago

Oh, that's fascinating. netstat says the socket is closed. I guess sockjs-node just didn't notice.

davidben commented 11 years ago

Looks like memory problems were a leak in my zephyr key management code. Let's see if things are happy now.

davidben commented 11 years ago

Still hitting swap. I don't think I've plugged everything yet. But that definitely helped.

davidben commented 11 years ago

Poking at a V8 heap snapshot. It may well be socket leaks. I'll take another when the swap rises too high again.

davidben commented 11 years ago

Poured over the snapshot. I don't see a path from the objects in question to a GC root. I'm so confused. Is it actually possible I'm hitting a bug like this or something? https://code.google.com/p/v8/issues/detail?id=2073

davidben commented 11 years ago

Okay, most recent node-zephyr fix definitely helped. The sockets thing is still a mystery.