Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Asset Trash Followup

Frans Charming
You only need one Frans
Join date: 28 Jan 2005
Posts: 1,847
05-05-2006 03:02
From: Kelly Linden
It is ... eventually. Asset garbage collection is a seperate system process that takes a not-insignificant amount of time to run and is run on a more or less continuous basis.

Knowing when to delete an asset isn't always as easy as just tracking when the item is not in anyone's inventory. Object contents are only known on a per sim basis, except for the hourly sim state saves - and the asset could be referenced in any sim. Scripts may also access items, textures for example, by a hard coded asset id. It wouldn't be right to break the object if the only person with an actual inventory copy deleted it. Doing so could break every SuperFoo that person has sold which has a script that uses the hard coded asset id.

So, yes, if it is truely not referenced anywhere it will eventually get deleted. But not immediately.


Curious person that i am. How is it determined when something isn't referenced anywhere?

Theory:
As you say it is a continues running thing. So i assume it is running through the sim-state-saves and user/object-inventory. Is it then updateting a timestamp for every asset it encounters? And a second routine is running through the asset server and deletes anything that has a timestamp that is older then current date minus a predefined interval? Is that how it work, or is this to simple?

Second, are scripts checked for keys of other assets? Or do they have to acces the assets once in a while to prevent them from magnetical destruction?
_____________________
Kelly Linden
Linden Developer
Join date: 29 Mar 2004
Posts: 896
05-05-2006 07:44
Let me first say our garbage collection routine is not the most advanced or best.

Our garbage collection routine has 2 phases:
1. Read through everything and store a list of all found asset ids. This means reading through all notecards, script source, simstates, attachments, task inventories and resident inventories etc. This creates one HUGE list of asset id's that are referenced somewhere, anywhere.

2. Anything not on that list gets deleted.

This means that burried items (assets referenced in scripts inside objects that get deleted) could take a few passes to be cleaned up, and that the whole process is kinda slow.

If rewriting and optimizing an asset garbage collection system sounds like fun, you should check out our empoyment page, particuarly the Systems Engineer role.
_____________________
- Kelly Linden