Good sleuthing! Pretty crappy algorithm that allows a cache to grow without
bounds.

The skins that come with WeeWX (Seasons, Standard) use static source
template files. They are always the same. So, if I understand you
correctly, each template should take only one slot in sys.modules.

Does the Belchertown skin do things differently?

-tk


On Sun, Jun 25, 2023 at 8:46 AM [email protected] <[email protected]>
wrote:

> In my experimental skin I was running into this issue, so I decided to
> delve into Cheetah’s internals and learned the following. As part of the
> compilation process the module is added to sys.modules and the generated
> code is cached. If one is dynamically generating template source and it is
> different, then it will not be found in the cache and an additional entry
> will be added to sys.modules and the cache. This will result in ever
> increasing memory usage. Since the OP was dynamically generating html and
> not Cheetah source, it could be included as ‘raw’. This skips the
> compilation step and the addition of it to sys.modules and the cache.
> - rich
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/c33494f0-1ff1-464e-b37c-df48f02dc1d3n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/c33494f0-1ff1-464e-b37c-df48f02dc1d3n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEC5Kfx6UYw9SQ9MVhtaabUwhP1b%2BMniw-A9qAdW9ovPLw%40mail.gmail.com.

Reply via email to