DB.GetMemoryUsage (Civ5 API)

From Civilization Modding Wiki
Jump to: navigation, search

This page is a part of the Lua and UI Reference (Civ5).


Function.png This function is a member of DB.

This is a static method, invoke it with a dot.


Returns the amount of memory currently in use by SQL


Usage

table DB.GetMemoryUsage()


Returned Value

Returns a table with the following fields:
NumRegions
The number of regions in memory used by the memory manager.
MaxUserAllocatedBytes
The highest amount, in bytes, of allocated space requested by the application.
Does not require CollectMemoryUsage.
CurrentUserAllocatedBytes
The current amount, in bytes, of allocated space requested by the application from the memory manager.
Does not require CollectMemoryUsage.
CurrentAllocatedBytes
The current amount, in bytes, of allocated space used by the memory manager.
CurrentReservedBytes
The total amount, in bytes, of reserved memory used by the memory manager.
CurrentOverheadBytes
The amount, in bytes, of the overhead used by the memory manager.
CurrentUncommitedBytes
The amount, in bytes, of the reserved space which has not been used.


Examples

DB.CollectMemoryUsage();
local usage = DB.GetMemoryUsage();
print("SQL is using " .. usage.NumRegions .. " blocks of memory right now.");


Source code samples

DebugMenu.lua

UI/InGame/DebugMenu.lua
0284
local dbmemory = DB.GetMemoryUsage();



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.