Skip to content

Memory/resource leak in postgresql process (probably by prepared statements) #263

Open
@enomado

Description

@enomado

Hi guys. I'm doing some performance-driven development and just and notice that my computer go to swap. All memory was consumed by postgresql processes.

It was just simple api called by wrk tool selecting table with something like

store := md.NewCategoryStore(db)
q := md.NewCategoryQuery()
cats, err := store.FindAll(q)

db.Exec("ROLLBACK;") doesnt help
db.Begin() ... tx.Rollback help but i didnt understand how.

I'm used to feel that nothing can leak in postgresql session and started thinking what it could be. Than i've noticed power using of prepared statements and gotcha, db.Exec("DEALLOCATE ALL") prevent leaking.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions