From: | Steve Clark <sclark(at)netwolves(dot)com> |
---|---|
To: | Steve Clark <sclark(at)netwolves(dot)com> |
Cc: | Michael Meskes <meskes(at)postgresql(dot)org>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: --enable-thread-safety bug |
Date: | 2008-03-22 21:05:44 |
Message-ID: | 47E574A8.9070809@netwolves.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Steve Clark wrote:
> Michael Meskes wrote:
>
>>On Sat, Mar 22, 2008 at 12:51:30PM -0400, Steve Clark wrote:
>>
>>
>>>My program had no threads - as I pointed out if I change the default
>>>Makefile in the FreeBSD ports
>>>system to not enable thread safety my programs runs just fine for days
>>>on end. It appears to me
>>>without any kind of close examination that there is a memory leak in the
>>>ecpg library when enable
>>>thread safety is turned on.
>>
>>
>>There are just a few variables covered by ENABLE_THREAD_SAFETY. I wonder
>>how the program manages to spend so much time allocating memory to eat
>>all of it. Could you give us some more info about your source code? Do
>>you use descriptors? Auto allocating?
>>
>>Michael
>
>
> Hi Michael,
>
> Not exactly sure what you are asking about - descriptors and auto
> allocating.
>
> The program processes about 800000 packets a day, which can update
> several tables.
> It runs continously reading udp packets from systems at remote
> locations coming in over the internet.
>
> It has a global
> exec sql include sqlca;
>
> then a number of functions that get called with each function having
> it own
>
> xxx( args,... )
> {
> EXEC SQL BEGIN DECLARE SECTION;
> a bunch of variable
> EXEC SQL END DECLARE SECTION;
>
> with various EXEC SQL inserts, updates and selects.
> with checks of sqlca.sqlcode to determine if the sql statement succeeded.
>
> }
>
> Steve
>
to further illustrate our code below is a typical exec sql statement:
exec sql insert into t_unit_event_log
(event_log_no,
unit_serial_no,
event_type,
event_category,
event_mesg,
event_severity,
event_status,
event_ref_log_no,
event_logged_by,
event_date,
alarm,
last_updated_by,
last_updated_date)
values (nextval('seq_event_log_no'),
:h_serial_no,
'ALERT',
:h_category,
:h_mesg,
:h_sev,
3,
NULL,
current_user,
now(),
:h_alarm,
current_user,
now());
if (sqlca.sqlcode != 0)
{
VARLOG(INFO, LOG_LEVEL_DBG4, "could not insert into
T_UNIT_EVENT_LOG\n");
VARLOG(INFO, LOG_LEVEL_DBG4, "insertTUEL returns %d\n", ret);
return ret;
}
From | Date | Subject | |
---|---|---|---|
Next Message | Douglas McNaught | 2008-03-22 21:25:34 | Re: Postgres connection error |
Previous Message | Steve Clark | 2008-03-22 20:58:28 | Re: --enable-thread-safety bug |