Re: BUG #1739: memory leak in pl/perl with spi_exec_query - Mailing list pgsql-bugs

From Jean-Max Reymond
Subject Re: BUG #1739: memory leak in pl/perl with spi_exec_query
Date
Msg-id 42C84D25.3030100@ckr-solutions.com
Whole thread Raw
In response to Re: BUG #1739: memory leak in pl/perl with spi_exec_query  (Jean-Max Reymond <jmreymond@ckr-solutions.com>)
Responses Re: BUG #1739: memory leak in pl/perl with spi_exec_query  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Jean-Max Reymond a écrit :

> Jean-Max Reymond a écrit :
>
>> The following bug has been logged online:
>>
>> Bug reference:      1739
>> Logged by:          Jean-Max Reymond
>> Email address:      jmreymond@ckr-solutions.com
>> PostgreSQL version: 8.0.3
>> Operating system:   Linux Ubuntu
>> Description:        memory leak in pl/perl with spi_exec_query
>
I have run again my real plperl procedure and attach a gdb to the process.
a call MemoryContextStats(TopMemoryContext) gives me the results as above.

is it possible for a guru to check that all is ok ?
A very interesting fact will be to prove that memory is not used by
spi_exec but by perl and confirm that memory allocation and garbage
collector in perl is pitifully.
I have very carefully read the thread "plperl doesn't release memory"
and I am not sure I am in the same context.

TopMemoryContext: 32768 total in 3 blocks; 4264 free (7 chunks); 28504 used
TopTransactionContext: 8192 total in 1 blocks; 6992 free (0 chunks);
1200 used
CurTransactionContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
SPI Exec: 57344 total in 3 blocks; 7520 free (4 chunks); 49824 used
ExecutorState: 8192 total in 1 blocks; 3368 free (4 chunks); 4824 used
ExecutorState: 8192 total in 1 blocks; 2048 free (0 chunks); 6144 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
AggContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
SPI Proc: 1015013376 total in 130 blocks; 1893336 free (0 chunks);
1013120040 used
SPI TupTable: 8192 total in 1 blocks; 6584 free (0 chunks); 1608 used
MessageContext: 8192 total in 1 blocks; 5400 free (1 chunks); 2792 used
PortalMemory: 8192 total in 1 blocks; 8040 free (0 chunks); 152 used
PortalHeapMemory: 1024 total in 1 blocks; 880 free (0 chunks); 144 used
ExecutorState: 8192 total in 1 blocks; 6864 free (1 chunks); 1328 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
CacheMemoryContext: 4186112 total in 9 blocks; 1214808 free (1 chunks);
2971304 used
index_xdb_pi: 1024 total in 1 blocks; 568 free (0 chunks); 456 used
index_xdb_str: 1024 total in 1 blocks; 712 free (0 chunks); 312 used
index_xdb_ele: 1024 total in 1 blocks; 696 free (0 chunks); 328 used
index_xdb_child: 1024 total in 1 blocks; 568 free (0 chunks); 456 used
index_xdb_attr: 1024 total in 1 blocks; 696 free (0 chunks); 328 used
pg_toast_1255_index: 1024 total in 1 blocks; 848 free (0 chunks); 176 used
pg_index_indrelid_index: 1024 total in 1 blocks; 912 free (0 chunks);
112 used
pg_user: 7168 total in 3 blocks; 3736 free (0 chunks); 3432 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; 6808 free (0 chunks); 1384 used
DynaHash: 8192 total in 1 blocks; 6624 free (0 chunks); 1568 used
CFuncHash: 8192 total in 1 blocks; 5080 free (0 chunks); 3112 used
Operator class cache: 8192 total in 1 blocks; 5080 free (0 chunks); 3112
used
Type information cache: 8192 total in 1 blocks; 2008 free (0 chunks);
6184 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


Attachment

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #1748: Unique contraints cannot be added to long text fields
Next
From: Tom Lane
Date:
Subject: Re: BUG #1739: memory leak in pl/perl with spi_exec_query