php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58014 Leaking memory when I use import
Submitted: 2008-01-21 10:49 UTC Modified: 2008-01-23 04:18 UTC
From: soid dot exe at hotmail dot com Assigned:
Status: Closed Package: oci8 (PECL)
PHP Version: 5.2.5 OS: Debian Linux 2.6.18-openvz-686
Private report: No CVE-ID: None
 [2008-01-21 10:49 UTC] soid dot exe at hotmail dot com
Description:
------------
I have a problem when I use the INSERT operation like that.

It seems this is leaking memory.
So I try to import a big file using the INSERTs and I have a memory overflow error.

Reproduce code:
---------------
<?php
print "PHP Stress Test!\n";

$conn = oci_connect('scott', 'tiger', 'xxxxx');

for ($i = 1; $i < 1000; $i++) {
if ($i % 100 == 0) print "#$i: " . memory_get_usage() . "\n";

$s = oci_parse($conn, "INSERT INTO TBL VALUES ($i, $i)");
oci_execute($s);
oci_free_statement($s);
}

?>


Expected result:
----------------
#100: 51196
#200: 59196
#300: 67196
#400: 75196
#500: 83196
#600: 89520
#700: 89772
#800: 90044
#900: 90296

First column is count of INSERTs, second's a memory use.
So it seems that's leaking memory.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-21 11:05 UTC] tony at daylessday dot org
Update PHP to the latest stable version and try again.
I believe what you see is Zend memory manager caching small memory blocks.
 [2008-01-23 04:18 UTC] soid dot exe at hotmail dot com
Thank a lot! I upgraded our PHP to version 5.2.5 and that works fine!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC