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
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: djgrrr at gmail dot com Assigned:
Status: Wont fix Package: runkit (PECL)
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
31 + 16 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 02:01:30 2024 UTC