[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] Understanding postgresql logs
From:       Jeff Janes <jeff.janes () gmail ! com>
Date:       2013-05-30 21:54:23
Message-ID: CAMkU=1zoVeR9NqXu=iCv4e9o-rtTBqXFu-gmz5FWvKyrE_Ezvg () mail ! gmail ! com
[Download RAW message or body]

On Mon, May 27, 2013 at 6:37 AM, igivanoff <igivanoff@yahoo.com> wrote:

> I have a PostgreSQL 9.0/9.2 which from time to time hits some memory
> issues.
> I know the best approach is to monitor the DB performance and activity but
> in the log files I see error messages similar to:
>
>
> TopMemoryContext: 221952 total in 17 blocks; 7440 free (41 chunks); 214512
> used
>   TopTransactionContext: 8192 total in 1 blocks; 6384 free (0 chunks); 1808
> used
>     CurTransactionContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
>   Type information cache: 24240 total in 2 blocks; 3744 free (0 chunks);
> 20496 used
>


You can look for the biggest contexts by copying all of these lines to a
file and then sorting it by something like "sort -t: -k2".

The biggest one I see is "CacheMemoryContext: 1359224 total", which is
pretty small, so the culprit is probably hidden behind the ellipsis in your
message.

      1 tm:2013-05-18 11:21:58.274 UTC db:VCDB pid:29515 ERROR:  out of
> memory
>       2 tm:2013-05-18 11:21:58.274 UTC db:VCDB pid:29515 DETAIL:  Failed on
> request of size 40.
>
> I've searched around for some documentation/books/posts on that topic but I
> failed to find detailed info what's TopMemoryContext,
> TopTransactionContext,
> CurTransactionContext etc. and how those values can be translated.
>

I doubt that most of these are documented anywhere except in the source
code.  You don't need to understand all of them, you can isolate just the
one which is very large, and grep the source code for it.

Most likely you just set maintenance_work_mem too large.

Cheers,

Jeff

[Attachment #3 (text/html)]

<div dir="ltr">On Mon, May 27, 2013 at 6:37 AM, igivanoff <span dir="ltr">&lt;<a \
href="mailto:igivanoff@yahoo.com" target="_blank">igivanoff@yahoo.com</a>&gt;</span> \
wrote:<br><div class="gmail_extra"><div class="gmail_quote"> <blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I \
have a PostgreSQL 9.0/9.2 which from time to time hits some memory issues.<br>

I know the best approach is to monitor the DB performance and activity but<br>
in the log files I see error messages similar to:<br>
<br>
<br>
TopMemoryContext: 221952 total in 17 blocks; 7440 free (41 chunks); 214512<br>
used<br>
  TopTransactionContext: 8192 total in 1 blocks; 6384 free (0 chunks); 1808<br>
used<br>
    CurTransactionContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used<br>
  Type information cache: 24240 total in 2 blocks; 3744 free (0 chunks);<br>
20496 used<br></blockquote><div><br></div><div><br></div><div style>You can look for \
the biggest contexts by copying all of these lines to a file and then sorting it by \
something like &quot;sort -t: -k2&quot;.</div><div style> <br></div><div style>The \
biggest one I see is &quot;CacheMemoryContext: 1359224 total&quot;, which is pretty \
small, so the culprit is probably hidden behind the ellipsis in your \
message.</div><div style><br></div><blockquote class="gmail_quote" style="margin:0px \
0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                
      1 tm:2013-05-18 11:21:58.274 UTC db:VCDB pid:29515 ERROR:  out of<br>
memory<br>
      2 tm:2013-05-18 11:21:58.274 UTC db:VCDB pid:29515 DETAIL:  Failed on<br>
request of size 40.<br>
<br>
I&#39;ve searched around for some documentation/books/posts on that topic but I<br>
failed to find detailed info what&#39;s TopMemoryContext, TopTransactionContext,<br>
CurTransactionContext etc. and how those values can be \
translated.<br></blockquote><div><br></div><div style>I doubt that most of these are \
documented anywhere except in the source code.  You don&#39;t need to understand all \
of them, you can isolate just the one which is very large, and grep the source code \
for it.</div> <div style><br></div><div style>Most likely you just set \
maintenance_work_mem too large.</div><div style><br></div><div \
style>Cheers,</div><div style><br></div><div style>Jeff</div></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic