Quantcast
Channel: iOS and tvOS
Viewing all articles
Browse latest Browse all 10823

Huge memory spikes on Texture2D.LoadImage()

$
0
0
Hi,

I met a trouble loading image from local path ( Application.persistentDataPath ). Normally app take 50-60mb, but after code
Code (CSharp):
  1. if (File.Exists(filePath))
  2. {
  3.      fileData                 = File.ReadAllBytes(filePath);
  4.      tex                        = new Texture2D(2, 2);
  5.      tex.LoadImage(fileData);
  6. }
that raise up to 180mb only for 2 small images 200x200px.
Using WWW method everything worked fine.

Does someone know why that happens? I am using Unity 5.4b19, but...

Huge memory spikes on Texture2D.LoadImage()

Viewing all articles
Browse latest Browse all 10823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>