[TYPO3-mvc] Memory Usage with 2000 Domain Objects
Tim Schoch | GSTALTIG
tim.schoch at gstaltig.ch
Tue Mar 22 14:21:46 CET 2011
@Lienhart: Your random thought is correct, I've changed the lazy loading to the
normal behaviour and the memory leakage is almost zero (1.5kb / 100 items).
The problem lies here (from the PHP manual) « When the root-buffer is full after
10,000 iterations (with a total of 10,000 possible roots), the garbage collection
mechanism kicks in ... » what means, that it will never be called in this example.
I have no Idea if this can be fixed or how to do it, so I'll have to leave the lazyloading
turned off at the moment.
Next problem:
I get a 100 second time out now after 18 loops. My guess was the manual garbage
collection for every item takes to long, so I commented it out and it worked.
But - without manually unregistering and unsetting not needed items
( @see 1. Mail [1] ) I still have a memory leak of aprox 4 - 5 mb per 100 items.
That's a total memory leak of 112 mb after 24 loops. It would work at the moment,
but it's russian roulet. If the client adds more items - Bam!
I measured the time it took with an interesting result:
With the manual garbage collection turned on, a loop over 100 items takes
somewhere around 5.low seconds and without it, one loop is stable around
4.7 seconds. Not that much of a difference but exactly what it takes to stay
below those 100 seconds. I guess I'll have to optimize some code inside the
loops.
Btw. with lazy loading turned on, one loop takes only 1.2 seconds. mkay ...
... I'll have to do some more testing.
@Christian: Thank you for your link, I've bookmarked it right away. This particular
problem ist related to extbase only, but I'm sure your extension will help me some
day with some thing.
[1] http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2011-March/008958.html
More information about the TYPO3-project-typo3v4mvc
mailing list