PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.smarty.general > Leaks?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Leaks?

Réponse
 
LinkBack Outils de la discussion
Vieux 18/10/2006, 13h25   #1 (permalink)
Marcus Bointon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Leaks?

I'm using smarty in our mailing list management system, and I'm
running into some memory issues. Unlike a typical web template
scenario where smarty renders a template just once, I typically
render a set of 3 related templates around 1000 times with different
assigned vars. To reduce instantiation overhead, I'm keeping the
smarty instance in a static var and clearing its contents in each
iteration.

Something in my loop is eating memory and not giving it back. Memory
is being eaten at a rate of about 10k per iteration, which is about
the size of the rendered templates. I've eliminated my database as
the source. Has anyone noticed Smarty doing this? Is there anything
particular that smarty might be storing and then not releasing?

Marcus
--
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk/
  Réponse avec citation
Vieux 18/10/2006, 13h50   #2 (permalink)
messju mohr
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Leaks?

On Wed, Oct 18, 2006 at 01:25:25PM +0100, Marcus Bointon wrote:
> I'm using smarty in our mailing list management system, and I'm
> running into some memory issues. Unlike a typical web template
> scenario where smarty renders a template just once, I typically
> render a set of 3 related templates around 1000 times with different
> assigned vars. To reduce instantiation overhead, I'm keeping the
> smarty instance in a static var and clearing its contents in each
> iteration.
>
> Something in my loop is eating memory and not giving it back. Memory
> is being eaten at a rate of about 10k per iteration, which is about
> the size of the rendered templates. I've eliminated my database as
> the source. Has anyone noticed Smarty doing this? Is there anything
> particular that smarty might be storing and then not releasing?


If you have caching enabled then smarty stores the rendered output in
memory in a static var in smarty_core_read_cache_file().

> Marcus
> --
> Marcus Bointon
> Synchromedia Limited: Creators of http://www.smartmessages.net/
> marcus@synchromedia.co.uk | http://www.synchromedia.co.uk/
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

  Réponse avec citation
Vieux 18/10/2006, 14h12   #3 (permalink)
Marcus Bointon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Leaks?

On 18 Oct 2006, at 13:50, messju mohr wrote:

> If you have caching enabled then smarty stores the rendered output in
> memory in a static var in smarty_core_read_cache_file().


I've got caching turned off - every render is dynamic.

I've tracked this down further. Each set of calls call to $smarty-
>fetch gets progressively slower - starting out at 0.02 sec, rising

to 0.1 after about 5,000 iterations - a factor of 5.

I've stopped the smarty instance from being static, so it gets a new
instance every time, but it's still showing the problem.

It could be one of my smarty plugins that's at fault, but I can't
think why RAM allocated by one would not be released when the smarty
instance is destroyed, or why it should affect the performance of a
completely different instance.

Marcus
--
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk/
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h51.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08622 seconds with 11 queries