11
votes
Vote UpVote

Optimizing for memory: a tighter TList

DelphiTools – One of the memory hogs when you have object trees or graphs can be good old TList and its many variants (TObjectList, TList<T>, etc.). This is especially an issue when you have thousandths of lists that typically hold very few items, or are empty. In the DWS expression tree f.i. there are quickly thousandths of such lists, for local symbol tables, parameter lists, etc. How much does a TList cost in terms of memory? A TList holding a single item already costs you: 4 bytes for the field in the owner object 20 bytes for the TList instance 8 hidden bytes: Monitor + VMT pointer 12 field ...
Favorite? Off-Topic? Eric @ 2010-10-28 13:09

Statistics

Visits: 1109
Votes: 11
Favorites: 1
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

AlinS
Barton_Stano
Charles Ardour
Daniele Teti
JC Chu
ket555
Robert Love
stukelly
vcldeveloper
Yogi Yang
Zzzzz
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)