Question by
JakeCaron · Dec 18, 2017 at 05:02 PM ·
2dtexturetexture2dmemory-leak
Memory leak with creating a new Texture2D
Hi all, simply making a new project and attaching the following code to a gameobject:
float time = 0;
void Update()
{
time += Time.deltaTime;
if(time >= .5f)
{
time = 0;
Texture2D screenShot = new Texture2D((int)1000, (int)1000, TextureFormat.RGBA32, false);
}
}
Anyone know why this makes the memory continuously increase? As far as I can tell, you cannot deallocate a Texture2D's memory -- it handles itself if it is not referenced by anything. Using version 5.5.2f1
Comment
Your answer
Follow this Question
Related Questions
Applying one sprite/texture across multiple gameobjects. (2D) 0 Answers
Make texture2D readable in runtime/script Unity3D 1 Answer
2D Sprite.Create isn't working 0 Answers
Unable to save generated/rendered Texture2D to use for billboard 3 Answers
How would I go about color correcting a Raw Image? 0 Answers