Interesting. So is the only way to do an in-memory cache to use my own "bytes used" counter, and a heuristic of how much I can afford to store?
(If so, that's kinda lame.) On Nov 24, 2011, at 12:47 AM, Nick Johnson wrote: > Weak references may not work as you expect in Python. Python uses both > reference counting and garbage collection; if the reference count of an > object goes to 0, it will be freed immediately, instead of waiting for > garbage collection. As a result, your cache may well be empty most or all of > the time. > > -Nick Johnson > > On Tue, Nov 22, 2011 at 12:46 AM, Joshua Smith <[email protected]> > wrote: > When building in-memory caches, it's typical to use a weak reference system > (like a WeakHashMap in Java) so you don't have to rely on heuristics for how > much memory you should use. Googling around, I found a thing called > WeakValueDictionary in python. Anyone here have experience using one of these > in GAE? > > On Nov 20, 2011, at 11:26 PM, Brandon Wirtz wrote: > >> You get an amount of ram close to but not always equal to 128M or ram PER >> instance. >> >> Python 2.7 uses more memory for Hello World, and less for most operations. >> They both use the same for storing things like Data Caches. >> >> You can use the local instance in addition to data store. Not instead. My >> apps waterfall from edge cache to instance memory to memcache to datastore >> Use all the ram you can, it is free. Don’t count on it being there, don’t >> over use it, and stick to the API’s and Libraries for accessing it, or the >> world will end violently. >> No, I won’t share code for doing this it is our biggest selling point. >> >> <image001.jpg> >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of JH >> Sent: Sunday, November 20, 2011 5:17 PM >> To: Google App Engine >> Subject: [google-appengine] Re: Using RAM instead of datastore - any limits? >> >> You get 128 megs of ram for front end instances. Also, so far my experience >> says that py 2.7 uses quite a bit more ram just to run hello world. >> >> On Nov 20, 5:58 pm, ThePiachu <[email protected]> wrote: >> > My application relies on accessing a lot of simple stored data and >> > displaying it. I'm considering storing all data in the RAM of the >> > application in order not to have problems with datastore access >> > quotas, but I'm not sure if there are any limits of how much data can >> > be stored this way. Is there any limit on how much data can one store >> > in say, a vector in RAM? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/google-appengine?hl=en. >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/google-appengine?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > > > -- > Nick Johnson, Developer Programs Engineer, App Engine > > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
