1

I have DB of size ~16GB Windows Server 2008 R2 (up to date).

We moved from Postgres v9.2.4 to Postgres v9.3.4 and now Postgres v9.3.4 memory usage is growing until is takes all the windows physical memory. On windows start up, physical memory usage is around 13%. In 48H this memory usage will increase to 70% and most of the memory is used by postgres.

But on Postgres v9.2.4 everything was fine, memory usage was reasonable. But I'm not able to understand what's wrong with Postgres v9.3.4.

To keep my application running, I had to restart the server for every 48hrs.

Did anyone had same issue and found any solutions? It will be highly appreciated it someone can help me with this.

9
  • 1
    Certainly not a known issue. Can you tell me more about the workload and configuration? Show your shared_buffers, work_mem, maintenance_work_mem, max_connections, etc. How do you measure the memory use? What actually happens if it starts using lots of RAM, are there any real effects? Apr 26, 2014 at 5:37
  • max_connections = 300 shared_buffers = 512MB temp_buffers = 256MB work_mem = 256MB #maintenance_work_mem = 16MB The system is running fine for 3 days but in the 4th day the physical memory usage in task manager in over 83% and the next error is stopping my posgresql service. "CreateProcess call failed: A blocking operation was interrupted by a call to WSACancelBlockingCall. (error code 8)" Apr 28, 2014 at 13:12
  • Your work_mem is too high if you're really using all those 300 connections, but I'd expect to see intermittent problems and swapping with that not a gradual growth. I wonder if you've found a memory leak somewhere. Can you tell me more about your workload? What extensions do you use, what kinds of queries do you run? Lots of small queries? What else is running on the same computer? If you restart PostgreSQL, not the whole server, does memory use go back down? Apr 29, 2014 at 2:07
  • No, we don’t really use all the 300 connections at the same time. Once we had 150 simultaneous connections and so to play it safe we configured it as 300. During the time work memory increases we hardly have 5 simultaneous connections. The workload is like, 70% small & 30% big queries. This is a dedicated machine just for db. "postgres.exe" "--forkboot" "2880" "-x4", "postgres.exe" "--forkboot" "2904" "-x3". These are the two processes which seem to grow gradually and never release memory. The first process is the one which grows very high and takes all the memory. Apr 29, 2014 at 13:44
  • 1
    Hi Craig, Our problem was solved. It was related to one of the drivers installed on machine; PostgreSQL had nothing to do with that. More info: link. It was caused by aksdf.sys and hardlock.sys driver files which was installed by Advantage Database Server v7.1 (we never used it though). But for every Postgres connection we had 20Kb of memory leak on machine. Now its removed and server is working fine. May 5, 2014 at 15:04

1 Answer 1

2

This problem was solved. It was related to couple of the drivers installed on machine; PostgreSQL had nothing to do with that.

To ready more info about this issue: link.

It was caused by aksdf.sys and hardlock.sys driver files which was installed by Advantage Database Server v7.1 (we never used it though).

Our suspicion went towards PostgreSQL at first because that was the only program which was getting used on that server. So for every PostgreSQL connection, we had a Zombie process consuming 20Kb of physical memory. Hence this continued until whole physical memory was consumed and then after that we had to reboot the machine to make it work.

We used following tools to track this issue:

  • RAMMAP (Most helpful)
  • PROCESS EXPLORER
  • TCPView

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .