PostgresDB 53200: Out of memory

When the database server runs out of memory during an operation.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Stuck? Let AI directly find root cause
AI that integrates with your stack & debugs automatically | Runs locally and privately
Download Now
What is

PostgresDB 53200: Out of memory

 ?
  1. Check current memory usage:
  2. SELECT pg_size_pretty(pg_database_size(current_database())) AS db_size;
  3. Identify large objects consuming space:
  4. SELECT nspname || '.' || relname AS "relation",
    pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
    FROM pg_class C
    LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
    WHERE nspname NOT IN ('pg_catalog', 'information_schema')
    ORDER BY pg_total_relation_size(C.oid) DESC
    LIMIT 10;
  5. Check long-running queries that might be locking resources:
  6. SELECT pid, now() - pg_stat_activity.query_start AS duration, query, state
    FROM pg_stat_activity
    WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes'
    AND state != 'idle'
    ORDER BY duration DESC;
  7. Terminate long-running queries if necessary:
  8. SELECT pg_cancel_backend(pid);
  9. If the issue persists, consider increasing the memory available to PostgreSQL:
    • Temporarily increase the work_mem setting for the current session:
    • SET work_mem = '256MB';
    • For a more permanent solution, modify postgresql.conf and restart the database:
      • Find the file location:
      • SHOW config_file;
      • Edit postgresql.conf, increase work_mem and/or shared_buffers, then restart PostgreSQL.
Attached error: 
PostgresDB 53200: Out of memory
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

PostgresDB

80+ monitoring tool integrations
Long term memory about your stack
Locally run Mac App available

Thank you for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.
Read more
Time to stop copy pasting your errors onto Google!

PostgresDB

80+ monitoring tool integrations
Long term memory about your stack
Locally run Mac App available

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

Thank you for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.
Read more
Time to stop copy pasting your errors onto Google!

MORE ISSUES

SOC 2 Type II
certifed
ISO 27001
certified
Deep Sea Tech Inc. — Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid