# GPU Memory Optimization

The GPU Memory Optimization provides significant improvement with Windows Display Driver Model (WDDM) drivers, as well as with the Tesla Compute Cluster (TCC) drivers. However, the reserved memory must be carefully selected, depending on the application. The highest gain in performance is for applications that process small images.

This option can be activated via the API:

- In the .NET API, set control.OptimizedGPUMemory(2.5*1024*1024*1024ul);
- In the C API, set vidi_optimized_gpu_memory(2.5*1024*1024*1024);

Pros | Cons
--- | ---
Reserves memory on the graphics card | Hard to estimate the correct amount of memory to reserve
No more time lost for memory allocation |

###### Graphic Card Memory

ViDi Memory Usage:

- Display, to store images prior to computation
- ViDi Reserved Memory, for computation
- Free memory, since the amount of memory used is not known, you must leave some free memory

An example for training:

- Reserved memory at 2.5GB (the minimal value for training)
- Free memory at about 1GB
- Which results in a graphics card with at least 3.5GB of memory

An example for rutime:

- Reserved memory at 512MB
- Free memory at about 256MB
- Which results in a graphics card with no minimal memory required