-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory problems again ... #87
Comments
heres an example code... if you execute this you can see in task manager how the memory is appended and appended and appended.... unset has no result. i tried to extend various classes with a destruct method, but at this moment i could not get a working result which cleans up the memory .... edit:: if the ->save() lines are commented out, everything works fine! therefore it has something to do with the save process...
|
I believe unset does not actually destroy the object, but rather marks it for garbage collections. PHP does have a way to force garbage collection using |
@ViperNeo It looks like the problem might be caused by some circular references that are not getting freed properly. Short term solution: add some code to free them properly. Long-term solution: eliminate all circular references. Although I will look into finding a solution, if you have any immediate solutions I am totally open to implementing them. |
@ViperNeo Here is a good article that explains why your Try calling |
i will give the gc_collect_cycles method a try... in the meantime i added this function to the Core_Object:
but that has no effect... if i have results, i will let you know! |
so far gc_collect_cycles has no effect too. memory usage is still increasing. |
Working on a possible short-term solution.
@ViperNeo I added some additional methods to help manage resources on the 3.3/develop branch that you may want to try playing around with. Try calling the
|
i have tested it... the memory usage is now a little bit better, but the execution time is doubled. |
@ViperNeo Did you try calling |
with dispose FALSE the performance improves, but big memory leaks again. i have implemented now a database abstraction layer at my own and do not using leap any more. import of my big 26MB file now takes 1 minute with a consistent memory usage of max. 8MB |
Hey Guys, i think memory management should be refactored again... if i am unsetting a DB_ORM_MODEL with unset() method or =NULL then the memory is not given free... i think __desctruct() have to be implemented on every object which have nested objects...
i am importing a 26MB file and have to create ove 50.000 ORM Models to save the complete file to my database. this fails because i get an memory error, max allowed size exhausted etc. i optimized my code to unset every object if it is not needed anymore, but php gives the memory not free... could you please refactor this?
The text was updated successfully, but these errors were encountered: