Skip to content

Pub/Sub : Large number of threads created leading to OutOfMemory #2724

@talonx

Description

@talonx

This is described in detail in netty/netty#7520 . Since I narrowed it down to being a PubSub problem, I'm logging it here. Please let me know if I should copy-paste the contents of the other issue here.

Turning off PubSub (and replacing it with an in-memory messaging system) in the same application leads to perfectly normal behaviour without any memory issues. I've also monitored this using jvisualvm, and one observation is that each time com.google.cloud.pubsub.v1.MessageDispatcher$2.run is called, lot of new threads get created and don't die. The heap dump also shows this, with around 37k threads.

PubSub version
0.26.0-beta

JVM version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

OS version
Linux 4.10.0-40-generic #44~16.04.1-Ubuntu SMP Thu Nov 9 15:37:44 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions