Thank you for this! On Tuesday, November 5, 2019 at 3:53:07 AM UTC+2, Rich Bell wrote: > > I'm running on: raspbian stretch, python 2.7.13, and WeeWX 3.9.1. > > I was noticing a steady increase in memory usage. I narrowed it down to > one service I had installed. This service binds to the loop event and makes > over 10 calls to getSql. I updated the service to open and close the > connection on each loop event. This seems to have stopped the memory > increase. > > Next, I wrote a small program that does the same steps. Create a > connection, get a cursor, execute a select, fetchone, close the cursor. But > this isn't exibiting the memory increase. > > Next I wrote a wrapper class for the Connection class and subclassed the > Cursor class, like WeeWX does. Running with these, I am again seeing the > memory increase. > > I don't see how the 'wrapper' classes should matter... Granted at 10+ > calls per loop, this is aproximately 240 calls a minute - so it would add > up fast; but I would think others would be seeing something too. I did see > this thread about the forecast service, > https://groups.google.com/forum/#!topic/weewx-user/H4GVpoI5l70/discussion > It looks to make a lot of calls to getSql, but binds to archive, so it > would happen a lot slower. Not sure if there was any resolution. > > I've attached my test program. It can call the sqlite classes directly or > use the 'wrapper' classes I stole from WeeWx. I may be all wet, but I'm > seeing something strange in my environment... I'll keep digging. > > -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/d0eaf730-6e4a-43b9-9678-59de3bc48952%40googlegroups.com.
