Re: Issue 3222 in sympy: Memory problems with the cache

2013-07-06 Thread sympy
Comment #15 on issue 3222 by asmeu...@gmail.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 By the way, the cache actually makes memory usage better in some cases, because it prevents multiple instances of the same object from being created. We sho

Re: Issue 3222 in sympy: Memory problems with the cache

2013-07-01 Thread sympy
Comment #14 on issue 3222 by asmeu...@gmail.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 Yes, from my understanding LRU is quite effective. We should just make a length limit, because that is easiest to implement, and fast (unless you want to tr

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-28 Thread sympy
Comment #13 on issue 3222 by supp...@mooncoder.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 A simple yet efficient idea for the cache is employing the least-recently-used-like (LRU-like) list. Every cache "hit" moves an item to the top of the li

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-20 Thread sympy
Comment #12 on issue 3222 by supp...@mooncoder.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 Looks like it is a "shallow" sizeof. But even if it worked with objects, this is not the right way to go IMO. How much would you expect the cache to be a

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-20 Thread sympy
Comment #11 on issue 3222 by asmeu...@gmail.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 But does it work on objects? That's what's stored in the cache: SymPy objects. -- You received this message because this project is configured to send all

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-20 Thread sympy
Comment #10 on issue 3222 by supp...@mooncoder.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 For python 2.6+, there is: import sys sys.getsizeof(2) 12 sys.getsizeof(2.0) 16 sys.getsizeof([1,2,3]) 48 sys.getsizeof([1,2,3.0]) 48 sys.getsizeof

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-19 Thread sympy
Comment #9 on issue 3222 by asmeu...@gmail.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 Oh wow, that's too complicated. Though actually we only care about the memory from objects that have a refcount of 1. I guess just counting the number of obj

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-19 Thread sympy
Comment #8 on issue 3222 by supp...@mooncoder.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 No, I don't have enough experience in python (yet :-) ). http://stackoverflow.com/questions/33978/find-out-how-much-memory-is-being-used-by-an-object-in-pytho

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-19 Thread sympy
Comment #7 on issue 3222 by asmeu...@gmail.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 I completely agree. There was some discussion on the mailing list about this issue a month or two ago. The idea is to make the cache more local, so that it d

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-19 Thread sympy
Comment #6 on issue 3222 by supp...@mooncoder.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 Documentation is one thing, but there is something more important. The cache mechanism can actually hurt sympy because for some people, "sympy crashes" or

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-18 Thread sympy
Comment #5 on issue 3222 by asmeu...@gmail.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 I agree that this should be documented better. -- You received this message because this project is configured to send all issue notifications to this address

Re: Issue 3222 in sympy: Memory problems with the cache

2013-06-18 Thread sympy
Comment #4 on issue 3222 by psotny...@gmail.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 The other problem with the cache is that people who don't know about it (or didn't know, like me) may spend a lot of time using profilers and generally blam

Re: Issue 3222 in sympy: Memory problems with the cache

2012-04-13 Thread sympy
Updates: Summary: Memory problems with the cache Status: Valid Comment #3 on issue 3222 by asmeu...@gmail.com: Memory problems with the cache http://code.google.com/p/sympy/issues/detail?id=3222 Great. Like I said, you'll probably want to use judicious calls to clear_cache(