Skip to content

crypto/tls: outBuf of Conn costs too much memory for large number of idle connections #42035

@cch123

Description

@cch123

What version of Go are you using (go version)?

$ go version
1.13

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

We are opening TLS on our online mesh project, which runs in a memory-limited situation. Currently, the TLS costs too much memory in some special apps which have about 100,000 connections

It can be calculated easily: 100,000 * max size of tlsConn.outBuf(16KB + some extra bytes) ≈ 1.6 GB(after go 1.12,), which can cause the process to OOM.

Most of the connections are idle, but still, use much memory because of this outBuf

What did you expect to see?

Don't use so much memory for massive idle tls connections

What did you see instead?

the process is killed by os because of OOM

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions