WebFaction
Community site: login faq

I'm having some issues with memory management on my Django app. The server consists of an API that will:

  1. Get 3000 objects from the db, each one 64 Bytes in size.
  2. Serialize them into JSON
  3. Send them via REST to the client

This one action increases my total memory consumption from ~200 MB to > 550MB almost instantly, which is a major problem. It doesn't make sense -- 3000 * 64 B = 192000 B = 0.192 MB, which is way less than the jump I'm seeing due to the request.

Does anyone know what might be going wrong?

asked 10 Aug '15, 18:50

packd's gravatar image

packd
155
accept rate: 0%


You can use a tool like Pympler to see exactly where Django is using memory:

permanent link

answered 10 Aug '15, 19:24

seanf's gravatar image

seanf ♦♦
11.9k21333
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×891
×82

question asked: 10 Aug '15, 18:50

question was seen: 1,150 times

last updated: 10 Aug '15, 19:24

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2017 PARAGON INTERNET GROUP LIMITED
WEBFACTION IS A SERVICE OF PARAGON INTERNET GROUP LIMITED
REGISTERED IN ENGLAND AND WALES 7573953 - VAT REGISTRATION NUMBER 182147021
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM