php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57270 runkit_function_remove should free up memory used by the function
Submitted: 2006-10-01 11:37 UTC Modified: 2006-10-01 16:06 UTC
From: djgrrr at gmail dot com Assigned:
Status: Wont fix Package: runkit (PECL)
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-10-01 11:37 UTC] djgrrr at gmail dot com
Description:
------------
It would be a lot nicer if runkit_function_remove actually freed up the memory used by the function, rather than just removing it from the function table


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-01 13:21 UTC] pollita@php.net
It does.

You're probably basing your statement on external indicators like get_memory_usage() which are only half-accurate.  When PHP "frees" per-request memory, it only marks it as free for potential reuse later on.  This makes big batches of malloc/free quicker and the rate of fragmentation slower for long running requests.

At the end of a request (or, in some cases, the end of a process space) it performs the actual free.

Short version: runkit is doing its job, PHP just has special way of doing its part.



Unless you're referring to the removal of built-in functions, in which case: The only thing to "free" is the compiled code and since that's going to be back in the function table next request there's really no point in doing that (Not to mention the fact that trying to free portions of program space while in runtime is just a bad idea).
 [2006-10-01 16:06 UTC] djgrrr at gmail dot com
it was actually an error on my part, i was using create_function to make lambda functions but my logic for keeping track of them was wrong

sorry for this
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Jun 24 03:01:46 2018 UTC