# Quickly Running Out Of Memory

Over the past months I have been developing an application using Vulkan. Recently I have implemented loading 3d models from .fbx files and their associated .png textures. At this point there appears to be no performance issues until you look at the memory usage.

A single, 4096x4096 10mb .png file after loaded is spiking memory usage over 500mb. Loading an 80,000 polygon .fbx file is spiking memory usage over 2GB! during the loading process and then it levels down around 800mb. That is still 800mb for loading 1 model and 1 texture and this is just on the CPU.

On the GPU, which as considerably less available ram than the CPU, just by looking at task manager, is showing about the same amount of usage. If I load in more model+texture pairs I can see memory usage on the GPU's graph take large steps up after transfer operations complete.

At this rate I wont be able to have but only a small handfull of objects in an entire scene.

So what am I doing wrong here? Just what important factor have I completely overlooked when designing this application?

This is a learn-as-you-go project, and i'm proud of myself for getting this far, but this memory issue is absolutely dumbfounding and I haven't a clue.

If anyone want's to have a rummage around in my code the project is up on GitHub.

• A 4096×4096 image is anything but simple for a GPU. PNG is not a format that GPUs can store textures as, so that image needs to be decompressed. It's an easy calculation: 4096×4096×4 is 64mb. – Maximus Minimus Nov 27 '19 at 1:06