Re: plperl doesn't release memory - Mailing list pgsql-general

From Sven Willenberger
Subject Re: plperl doesn't release memory
Date
Msg-id 1111689282.11785.35.camel@lanshark.dmv.com
Whole thread Raw
In response to Re: plperl doesn't release memory  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: plperl doesn't release memory
List pgsql-general
On Thu, 2005-03-24 at 11:34 -0500, Tom Lane wrote:
> Sven Willenberger <sven@dmv.com> writes:
> > Any suggestions on how to trace what is going on? Debug output methods?
>
> The first thing to figure out is whether the leak is inside Perl or in
> Postgres proper.  If I were trying to do this I'd run the function a
> couple times, then attach to the (idle) backend with gdb and do
>     call MemoryContextStats(TopMemoryContext)
> to dump a summary of Postgres' memory usage to stderr.  If that doesn't
> show any remarkable bloat then the problem is inside Perl (and beyond my
> ability to do much with).
>
> One thing I'm still a bit baffled about is why my test didn't show a
> problem; it sure looks identical to yours.  Maybe the issue is Perl
> version specific?  I tested using the current FC3 version, which is
> perl-5.8.5-9.
>
>             regards, tom lane

Not sure entirely how to interpret the results ... a cursory examination
shows 516096 total in cachememory but I don't know if that reflects the
state of "unfreed" memory (or perhaps the 354728 used is unfreed?):

TopMemoryContext: 32768 total in 3 blocks; 7392 free (51 chunks); 25376
used
MessageContext: 8192 total in 1 blocks; 7912 free (1 chunks); 280 used
PortalMemory: 8192 total in 1 blocks; 8176 free (1 chunks); 16 used
CacheMemoryContext: 516096 total in 6 blocks; 161368 free (1 chunks);
354728 used
lookup_state_idx: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
lookup_ocn_idx: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
lookup_lata_idx: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
locate_npanxx_idx: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
matall_intra_idx: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
matall_inter_idx: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
matall_npanxx_idx: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
offshore_pkey: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
pg_index_indrelid_index: 1024 total in 1 blocks; 912 free (0 chunks);
112 used
pg_attrdef_adrelid_adnum_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_namespace_nspname_index: 1024 total in 1 blocks; 912 free (0 chunks);
112 used
pg_attribute_relid_attnum_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_shadow_usesysid_index: 1024 total in 1 blocks; 912 free (0 chunks);
112 used
pg_aggregate_fnoid_index: 1024 total in 1 blocks; 912 free (0 chunks);
112 used
pg_class_relname_nsp_index: 1024 total in 1 blocks; 848 free (0 chunks);
176 used
pg_rewrite_rel_rulename_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_inherits_relid_seqno_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_cast_source_target_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_type_oid_index: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
pg_language_name_index: 1024 total in 1 blocks; 912 free (0 chunks); 112
used
pg_class_oid_index: 1024 total in 1 blocks; 912 free (0 chunks); 112
used
pg_operator_oid_index: 1024 total in 1 blocks; 912 free (0 chunks); 112
used
pg_operator_oprname_l_r_n_index: 1024 total in 1 blocks; 712 free (0
chunks); 312 used
pg_statistic_relid_att_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_proc_oid_index: 1024 total in 1 blocks; 912 free (0 chunks); 112 used
pg_amop_opc_strat_index: 1024 total in 1 blocks; 776 free (0 chunks);
248 used
pg_opclass_am_name_nsp_index: 1024 total in 1 blocks; 776 free (0
chunks); 248 used
pg_index_indexrelid_index: 1024 total in 1 blocks; 912 free (0 chunks);
112 used
pg_conversion_name_nsp_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_conversion_oid_index: 1024 total in 1 blocks; 912 free (0 chunks);
112 used
pg_trigger_tgrelid_tgname_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_amproc_opc_proc_index: 1024 total in 1 blocks; 776 free (0 chunks);
248 used
pg_language_oid_index: 1024 total in 1 blocks; 912 free (0 chunks); 112
used
pg_conversion_default_index: 1024 total in 1 blocks; 712 free (0
chunks); 312 used
pg_shadow_usename_index: 1024 total in 1 blocks; 912 free (0 chunks);
112 used
pg_attribute_relid_attnam_index: 1024 total in 1 blocks; 848 free (0
chunks); 176 used
pg_namespace_oid_index: 1024 total in 1 blocks; 912 free (0 chunks); 112
used
pg_group_sysid_index: 1024 total in 1 blocks; 912 free (0 chunks); 112
used
pg_proc_proname_args_nsp_index: 1024 total in 1 blocks; 712 free (0
chunks); 312 used
pg_group_name_index: 1024 total in 1 blocks; 912 free (0 chunks); 112
used
pg_type_typname_nsp_index: 1024 total in 1 blocks; 848 free (0 chunks);
176 used
pg_opclass_oid_index: 1024 total in 1 blocks; 912 free (0 chunks); 112
used
pg_amop_opr_opc_index: 1024 total in 1 blocks; 848 free (0 chunks); 176
used
MdSmgr: 8192 total in 1 blocks; 7000 free (0 chunks); 1192 used
DynaHash: 8192 total in 1 blocks; 6776 free (0 chunks); 1416 used
Operator class cache: 8192 total in 1 blocks; 5080 free (0 chunks); 3112
used
CFuncHash: 8192 total in 1 blocks; 5080 free (0 chunks); 3112 used
smgr relation table: 8192 total in 1 blocks; 3016 free (0 chunks); 5176
used
Portal hash: 8192 total in 1 blocks; 2008 free (0 chunks); 6184 used
Relcache by OID: 8192 total in 1 blocks; 3520 free (0 chunks); 4672 used
Relcache by name: 24576 total in 2 blocks; 13240 free (5 chunks); 11336
used
LockTable (locallock hash): 8192 total in 1 blocks; 4056 free (0
chunks); 4136 used
ErrorContext: 8192 total in 1 blocks; 8176 free (0 chunks); 16 used

Sven


pgsql-general by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Good Books
Next
From: Tom Lane
Date:
Subject: Re: plperl doesn't release memory