guppy를 설치하고 내 django 앱을 프로파일 링하기 위해이 tutorial을 따라갔습니다. 내 django 응용 프로그램은 메모리 누수가 없지만 일부 이상한 이유로 Apache/mod_wsgi 환경에서 많은 메모리가 필요합니다. 수입품 중 하나가이 문제의 원인이라고 들었습니다.django와 guppy가 더 많은 메모리가 필요합니다.
구피를 사용하여 더 많은 메모리를 소비하는 가져 오기를 어떻게 확인할 수 있습니까? 내 수준에 대한 결과는 그리 유익하지 않습니다. 여기에 :
*** Connection 1 opened ***
<Monitor> lc
CID PID ARGV
1 2056 ['manage.py', 'runserver']
<Monitor> sc 1
Remote connection 1. To return to Monitor, type <Ctrl-C> or .<RETURN>
<Annex> int
Remote interactive console. To return to Annex, type '-'.
>>> hp.heap()
GC hook object was referred to from somebody!
Partition of a set of 128202 objects. Total size = 11015508 bytes.
Index Count % Size % Cumulative % Kind (class/dict of class)
0 55746 43 4117640 37 4117640 37 str
1 29278 23 1272920 12 5390560 49 tuple
2 2457 2 777324 7 6167884 56 dict (no owner)
3 495 0 583860 5 6751744 61 dict of module
4 8361 7 501660 5 7253404 66 function
5 7202 6 489736 4 7743140 70 types.CodeType
6 1026 1 461748 4 8204888 74 type
7 1022 1 402472 4 8607360 78 dict of type
8 179 0 250852 2 8858212 80 dict of django.db.models.fields.CharField
9 2599 2 156124 1 9014336 82 list
<486 more rows. Type e.g. '_.more' to view.>