Jump to content

Can loaded assets clutter the memory?


Phodex Games
 Share

Recommended Posts

I am not 100% sure about this for quiet a while now, so I though why not just ask :). I am not yet completely familiar with loading & releasing assets. Does an Asset, e.g an Sound which gets loaded, although I have loaded it before affect my memory, or does Leadwerks handle this automatically? So if I do something like below is the sound stored seperatly for every variable, or only once and loading him again has no effect? And what about models? If you load them they get placed in your scene for every load command. I have seen that sometimes you load in an asset use it for something and then directly release it again. I hardly release my assets and would appreciate every information about best practices for when to release your assets and when to best use instancing and when not, as I want to opimise this aspect as good as possible to increase speed & performance.

function Script:Start()
	local sound1 = Sound:Load("mysound.wav")
	local sound2 = Sound:Load("mysound.wav")
	local sound3 = Sound:Load("mysound.wav")
end

Thanks in advance :)

Markus from Phodex Games

Link to comment
Share on other sites

If you watch the program log you can see when assets are actually loaded. The code above would only load the sound once and then return a copy of it afterwards.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...