Re: Memory usage depends on number of fields in model, in a strange way

2010-07-31 Thread OverKrik
Jacob, thank you for an excellent explanation. On Jul 31, 7:36 pm, Jacob Kaplan-Moss wrote: > On Sat, Jul 31, 2010 at 7:20 AM, OverKrik wrote: > > Hi, I am not having any memory leaks, just checking how much memory > > every part of django use out of interest.(And because I am writing an > > art

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-31 Thread Jacob Kaplan-Moss
On Sat, Jul 31, 2010 at 7:20 AM, OverKrik wrote: > Hi, I am not having any memory leaks, just checking how much memory > every part of django use out of interest.(And because I am writing an > article about how Django ORM rocks :) ). You've constructed a somewhat artificial situation -- in the re

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-31 Thread OverKrik
Hi, I am not having any memory leaks, just checking how much memory every part of django use out of interest.(And because I am writing an article about how Django ORM rocks :) ). On Jul 31, 3:40 pm, Sergej dergatsjev eecho wrote: > Why are you testing? > > Have you seen memory leak somewhere? > >

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-31 Thread Sergej dergatsjev eecho
Why are you testing? Have you seen memory leak somewhere? I ask it because. I had problems with memory leaks in configuration (Mysql, Apache, mod_python) but it was bad configuration of Mysql server and Apache. If you send information about your test environment. We can better reproduce you pro

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-31 Thread OverKrik
Nope, I am testing Django memory usage for different kind of objects, and create 10 instances to minimize per-object measurement error, memory usage pattern is exactly the same for 100 or 1000 objects. On Jul 31, 9:30 am, hcarvalhoalves wrote: > """ > class U(models.Model): >     name = model

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-30 Thread hcarvalhoalves
""" class U(models.Model): name = models.TextField(max_length = 255, blank = False) name2 = models.TextField(max_length = 255, blank = False) name3 = models.TextField(max_length = 255, blank = False) ... data = [U() for x in xrange(10)] """ What is this actually trying to test?

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-30 Thread OverKrik
Thx Alex, should I post minimal testapp just to make sure? I really tried triggering this with my own classes, but had no luck even with pretty complex ones. On Jul 31, 3:50 am, Alex Gaynor wrote: > This isn't something django can help, it has to do with the overallocation > patterns for python d

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-30 Thread OverKrik
Hi, I am using "mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1" on Ubuntu 10.04 but I am not using database for this tests and not syncdb'ing my models (I know, this sounds wrong, but after syncdb nothing changes and I was making sure it's not because of database).

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-30 Thread Alex Gaynor
This isn't something django can help, it has to do with the overallocation patterns for python dicts. You would see this for any pytho obj with the right number of fields. Alex On Jul 30, 2010 7:17 PM, "Jacob Kaplan-Moss" wrote: On Fri, Jul 30, 2010 at 5:59 PM, OverKrik wrote: > Hi, I've been

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-30 Thread OverKrik
Oh, and I am using latest Django svn but can reproduce this with 1.1 too On Jul 31, 3:17 am, Jacob Kaplan-Moss wrote: > On Fri, Jul 30, 2010 at 5:59 PM, OverKrik wrote: > > Hi, I've been profiling Django to see how much overhead is being added > > by ORM, and found a very strange case of memory

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-30 Thread Jacob Kaplan-Moss
On Fri, Jul 30, 2010 at 5:59 PM, OverKrik wrote: > Hi, I've been profiling Django to see how much overhead is being added > by ORM, and found a very strange case of memory usage(which is either > some kind of bug or me misunderstanding low level stuff) - as long as > I have 0 to 3 fields of any ty

Re: Memory usage depends on number of fields in model, in a strange way

2010-07-30 Thread OverKrik
Just to clarify, I am talking about model fields :) class U(models.Model): name = models.TextField(max_length = 255, blank = False) name2 = models.TextField(max_length = 255, blank = False) name3 = models.TextField(max_length = 255, blank = False) #name4 = models.TextField(max_len

Memory usage depends on number of fields in model, in a strange way

2010-07-30 Thread OverKrik
Hi, I've been profiling Django to see how much overhead is being added by ORM, and found a very strange case of memory usage(which is either some kind of bug or me misunderstanding low level stuff) - as long as I have 0 to 3 fields of any type - memory usage is around 45MB ( I create list of 100 00