0

Here's my software environment

OS: Windows Server 2016 version 1607
Database: PostgreSQL 12.12
Backend application: Django 4.0.8
RamMap: v1.61

I have memory leakage issue on this server and tried using RamMap to find out what's possibly cause this problem. As you can see in the attached image below, I have a lot of postgres.exe listing on the Processes page with pid and 4K Private bytes, but none of these shows up in Task Manager screen.

All clients access PostgreSQL use http POST via my Django backend application installed on other server.

I've tried some ways but fail:

  1. taskkill /f /pid <PID> did not work since they're not show in Task Manager.
  2. restart PostgreSQL service but theses zombie processes were still there.
  3. slow down clients access speed but these processes were still increasing.

I have no idea how can I do to kill these processes. Could anyone give me some instructions to solve this problem? or the zombie processes is not even an issue that they will just there and have nothing to do with memory leakage?

After running this query script:

 SELECT state, backend_type, count(*) FROM pg_stat_activity GROUP BY state, backend_type ORDER BY backend_type, state;

I have

state backend_type count
NULL autovacuum launcher 1
NULL background writer 1
NULL checkpointer 1
active client_backend 1
idle client_backend 1
NULL logical replication launcher 1
NULL walwriter 1

enter image description here

1 Answer 1

0

These processes are client backends; they are the server side of a database connection. You terminate these processes by closing the database connection on the client side. So if you want to get rid of these processes, find and fix the connection leak in your application. And please don't ask how to do that – it is your application code.

On the other hand, why do these processes bother you (unless you are hitting max_connections)? 4kB of memory is very little, unless you happen to run PostgreSQL on a toaster.

Sign up to request clarification or add additional context in comments.

2 Comments

it bothers me because when I run the server for months, the memory usage goes up to 100% and shut down all the applications. It happened couple times. BTW I do have PostgreSQL max_connections = 100 however these process numbers are way more than 100
These processes are not what uses all your memory. Run the following: SELECT state, backend_type, count(*) FROM pg_stat_activity GROUP BY state, backend_type ORDER BY backend_type, state;, edit the question and add the result there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.