# FAQ: What is the difference between "in-use" and "allocated" memory?

**URL:** https://forum.techsoft3d.com/t/faq-what-is-the-difference-between-in-use-and-allocated-memory/1391
**Category:** HOOPS Visualize Desktop
**Tags:** faq, knowledge-base
**Created:** [February 16, 2022, 5:00am UTC](https://forum.techsoft3d.com/t/faq-what-is-the-difference-between-in-use-and-allocated-memory/1391 "2022-02-16T05:00:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gabriel.peragine](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/gabriel.peragine/32/1535_2.png) [@gabriel.peragine](https://forum.techsoft3d.com/u/gabriel.peragine)
#### Post date: [February 16, 2022, 5:00am UTC](https://forum.techsoft3d.com/t/faq-what-is-the-difference-between-in-use-and-allocated-memory/1391/1 "2022-02-16T05:00:00Z")

</div>

## Introduction

The primary concern is HOOPS Visualize’s usage of system main memory. The dynamic allocation and releasing of memory in Visualize is controlled by an internal memory manager. The memory manager may allocate memory in numerous situations, such as when objects are inserted into the database, an update is performed, or files are loaded. As items are removed from the database, the memory manager takes care of the freeing of the memory associated with them. Visualize allocates memory using its own memory pool and attempts to reuse memory chunks after entities are deleted.

## Query System Memory Usage

The amount of memory in use can be queried using `HPS::Database::ShowMemoryUsage`. This function will tell us how much system-memory HOOPS has allocated and how much is currently in use. “Allocated” refers to the amount of system memory allocated by Visualize’s memory manager. “In use” refers to the amount of memory currently used by the HOOPS scene-graph, which may be less than the amount actually allocated.

## Query Video Memory Usage

The total amount of video-memory available in the execution environment can be queried using `HPS::WindowInfoControl::ShowVideoMemory`. However, there are no APIs to strictly query HOOPS Visualize’s usage of frame buffer-memory. But that should not be a big concern, because it’s not system memory usage; rather, it’s video-memory allocated on the video card.

The amount of system-memory that HOOPS Visualize has allocated is always going to be the allocated value of `HPS::Database::SowMemoryUsage`. All other system-memory usage is due to the application’s other data-structures, **along with**  **any other system-memory usage that is not explicitly allocated by HOOPS Visualize**.

## Conclusion

This means when HOOPS Visualize tells the graphics API (OpenGL or Direct3D) to allocate display lists or vertex buffer objects in the video memory, the lower-level OpenGL/Direct3D drivers may _also_ choose to shadow/backup the graphics items in system-memory.

For example, the graphics card may be caching 1GB of graphical entities in the video-memory, but say 500MB of that is _also_ backed-up in system memory. HOOPS Visualize has no knowledge or control over that lower-level system-memory usage.

## Additional Resources

More information can be found in our Programming Guide page about [Memory Management](https://docs.techsoft3d.com/hps/latest/prog_guide/0704_memory_management.html).
