Memory usage and storing objects references as custom props

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
phao
Grandmaster Poster
Posts: 129
Joined: Fri Aug 31, 2007 2:25 pm

Memory usage and storing objects references as custom props

Post by phao »

I know a reference to something is normally WAY smaller than the thing itself, but I don't know how POL handles references to its objects.

So, is there any problem of high memory usage related to storing object references in custom properties?

I'm implementing a small chat system that uses a global property that is a dictionary mapping room names to array of player references. That is why I'm asking the question.
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Memory usage and storing objects references as custom props

Post by Tomi »

You should store the player serials instead and use SystemFindObjectBySerial to get the references again.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Memory usage and storing objects references as custom props

Post by CWO »

As a general rule you should never store references in a prop. Do exactly as Tomi suggests with storing serials. This is because props and references don't play nice with eachother.
Post Reply