Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'alternatives': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'rejected': 0.09; 'wrote': 0.14; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'specifying': 0.16; 'try?': 0.16; 'properly': 0.19; 'code,': 0.22; 'header:X-Complaints-To:1': 0.27; 'closer': 0.31; 'subject:size': 0.31; 'knowledge': 0.35; 'problem.': 0.35; 'objects': 0.35; 'but': 0.35; 'list': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; "you're": 0.61; "you've": 0.63; 'high': 0.63; 'received:myvzw.com': 0.84; 'subject::': 0.85; 'from.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re:Finding size of Variable Date: Tue, 4 Feb 2014 14:21:31 -0500 (EST) Organization: news.gmane.org References: <8e4c1ab1-e65d-483f-ad9d-6933ae2052c3@googlegroups.com> X-Gmane-NNTP-Posting-Host: 110.sub-70-208-163.myvzw.com X-Newsreader: PiaoHong Usenet NewsReaders 1.36 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391541507 news.xs4all.nl 2910 [2001:888:2000:d::a6]:60781 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65444 Ayushi Dalmia Wrote in message: > > Where am I going wrong? What are the alternatives I can try? You've rejected all the alternatives so far without showing your code, or even properly specifying your problem. To get the "total" size of a list of strings, try (untested): a = sys.getsizeof (mylist ) for item in mylist: a += sys.getsizeof (item) This can be high if some of the strings are interned and get counted twice. But you're not likely to get closer without some knowledge of the data objects and where they come from. -- DaveA