Re: ZODB eating CPU but RAM is free
Jim Fulton <[email protected]> Sat, 15 Dec 2018 09:30:04 -0700
| Newsgroups | gmane.comp.web.zope.zodb |
|---|---|
| Message-ID | <CAPDm-FgEJfWf=PEBuMM67omDTZeGWti_45D6-ASs6BLSMp6JpA@mail.gmail.com> |
--0000000000000911e5057d12104a Content-Type: text/plain; charset="UTF-8" On Fri, Dec 14, 2018 at 9:54 PM Vlad Oles <[email protected]> wrote: > On Wednesday, July 19, 2017 at 9:54:05 AM UTC-7, Jim Fulton wrote: >> >> >> One thing to understand is that ZODB doesn't limit memory usage. >> Ghostifies objects to meet memory settings at certain times like >> transaction boundaries and when asked to explicitly. So a transaction that >> loads a lot of objects can grow ram without bound. This is why >> applications that load *lots* of objects should explicitly reduce cache >> size by calling _p_jar.cacheGC() occasionally. >> > > Does it mean that after a database is finalized (no more writing and thus > transactions), there is no way to bound its RAM cache size other than > manually resetting cache (via cacheGC() or cacheMinimize()) after every N > reads? > Define finalized. When a transaction is committed or a connection closed, the connection's cache is reduced to it's target size. When a database is closed, the connections and their memory is freed. (If there are cycles, the Python garbage collection may take some time to deal with them.) Jim -- Jim Fulton http://jimfulton.info -- You received this message because you are subscribed to the Google Groups "zodb" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout. --0000000000000911e5057d12104a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Fri= , Dec 14, 2018 at 9:54 PM Vlad Oles <<a href=3D"mailto:vladyslav.oles@gm= ail.com">[email protected]</a>> wrote:<br></div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex"><div dir=3D"ltr">On Wednesday, July 19, 20= 17 at 9:54:05 AM UTC-7, Jim Fulton wrote:<blockquote class=3D"gmail_quote" = style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa= dding-left:1ex"><div dir=3D"ltr"><br><div><div class=3D"gmail_quote"><div>O= ne thing to understand is that ZODB doesn't limit memory usage.=C2=A0 G= hostifies objects to meet memory settings at certain times like transaction= boundaries and when asked to explicitly.=C2=A0 So a transaction that loads= a lot of objects can grow ram without bound.=C2=A0 This is why application= s that load <b>lots</b> of objects should explicitly reduce cache size by c= alling <font face=3D"monospace, monospace">_p_jar.cacheGC()</font> occasion= ally. <br></div></div></div></div></blockquote><div><br></div><div>Does it = mean that after a database is finalized (no more writing and thus transacti= ons), there is no way to bound its RAM cache size other than manually reset= ting cache (via cacheGC() or cacheMinimize()) after every N reads?</div></d= iv></blockquote><div><br></div><div>Define finalized.</div><div><br></div><= div>When a transaction is committed or a connection closed, the connection&= #39;s cache is reduced to it's target size. When a database is closed, = the connections and their memory is freed. (If there are cycles, the Python= garbage collection may take some time to deal with them.)</div><div><br></= div><div>Jim</div><div><br></div></div>-- <br><div dir=3D"ltr" class=3D"gma= il_signature">Jim Fulton<br><a href=3D"http://jimfulton.info" target=3D"_bl= ank">http://jimfulton.info</a><br></div></div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;zodb" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:[email protected]">zodb+unsubscri= [email protected]</a>.<br /> For more options, visit <a href=3D"https://groups.google.com/d/optout">http= s://groups.google.com/d/optout</a>.<br /> --0000000000000911e5057d12104a--