Wayyyyy higher texture memory than appropriate

Memory consumption for this texture should be around 2.4 MB, but instead it’s being reported as 51.7 MB. It’s also causing crashes on lots of android devices because of this (devices are running out of memory).

Which compression is used?
Can you send a screenshot of the texture in the editor?
1 texture of this size also should be fine. I see all your textures combined are really big. Maybe export to half res on android?

ASTC compression, but it doesn’t even matter, because 51.7 MB is wayyy over even the uncompressed size of a 2K LDR RGB texture.

For some reason Unity is generating huge amounts of memory here for no apparent reason.

It seems to possibly only be an issue when global mip bias is 0, but maybe it’s just because the issue is exacerbated here.

I think what’s happening here is that the device does not support astc compression - as it is not yet widely adpoted on Android. Thus unity decompresses the texture into memory (you can find a build setting for it to choose 16-bit or 32-bit but default is 32) - so I would assume 2048x2048x32bit => ~16mb + you get the mip maps for different levels. Also maybe you have read-write active on the texture - in such a case the texture will be loaded twice (cpu + gpu memory)

Try different texture formats - for example ETC with crunch support, also ensure the texture is a pot (i.e. 2048x2048) and ensure the texture compression is set for the “Android” Tab in the texture import settings.

1 Like

ASTC is definitely supported, it’s a Galaxy Note 20 Ultra. And also ASTC is 100% supported as long as you aren’t targeting low end devices (77% support for ASTC in 2020 according to Google, which includes many low end devices : https://developer.android.com/guide/playcore/asset-delivery/texture-compression)

Also it is not read/write, as shown in the screenshot.

Even if it were getting uncompressed, that does not somehow add up to 51.7 MB, even with mip maps.

Did you try to turn off Texture Streaming?

Are you using asset bundles or addressables? It could be caused by asset dependency duplication.

Also, what are the settings for those other rather big textures? Do they have the same dimensions and compression settings?

Haven’t tried that yet. That’s my number 1 suspect though. Have a feeling it’s loading in a bunch of data and taking longer to unload. If so, that’s a poor texture streaming system :confused:

should all be ASTC, similar settings. those textures are not part of any adressables / asset bundles.

In Release Notes of Unity 2023.2.0b5 :

Maybe it’s related to the issue above.