Stay organized with collections
Save and categorize content based on your preferences.
memory_advice
Summary
Functions
BaseTests
int32_t BaseTests()
GetAvailableMemory
int64_t GetAvailableMemory()
GetPercentageAvailableMemory
float GetPercentageAvailableMemory()
GetTotalMemory
int64_t GetTotalMemory()
RegisterWatcher
MemoryAdvice_ErrorCode RegisterWatcher(
uint64_t intervalMillis,
MemoryAdvice_WatcherCallback callback,
void *user_data
)
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-11-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-27 UTC."],[],[],null,["# memory_advice Namespace\n\nmemory_advice\n=============\n\nSummary\n-------\n\n| ### Functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [BaseTests](#namespacememory__advice_1a06ca76fd4aad6079dcd7283e46a5056c)`()` | `int32_t` |\n| [GetAdvice](#namespacememory__advice_1adac01acd15c5647cbb6b434a0233975b)`(`[MemoryAdvice_JsonSerialization](/reference/games/memory-advice/struct/memory-advice-json-serialization#struct_memory_advice___json_serialization)` *advice)` | [MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) |\n| [GetAvailableMemory](#namespacememory__advice_1af6acbc96987558095767da9e9003f9d9)`()` | `int64_t` |\n| [GetMemoryState](#namespacememory__advice_1a4169e3066741aafebd3b0bd16deae2db)`()` | [MemoryAdvice_MemoryState](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga33ecd5ed818cf6f8cefa3f63d1f998bb) |\n| [GetPercentageAvailableMemory](#namespacememory__advice_1a1de9abca0d1f4bb7e57c941f3e5746b6)`()` | `float` |\n| [GetTotalMemory](#namespacememory__advice_1a60316236ea8ab4844107c9f600f60a3d)`()` | `int64_t` |\n| [Init](#namespacememory__advice_1a3547d4be4200a001f6fddb1b9edb540d)`(const char *params)` | [MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) |\n| [Init](#namespacememory__advice_1a41eb5e978a95699fe8bbeab830cc5cfd)`()` | [MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) |\n| [MemoryAdvice_JsonSerialization_Dealloc](#namespacememory__advice_1ac4582ebff6e1f03f10f822359ec70963)`(`[MemoryAdvice_JsonSerialization](/reference/games/memory-advice/struct/memory-advice-json-serialization#struct_memory_advice___json_serialization)` *c)` | `void` |\n| [RegisterWatcher](#namespacememory__advice_1a9accaa0c3b8cb6342fed592e4df77f79)`(uint64_t intervalMillis, MemoryAdvice_WatcherCallback callback, void *user_data)` | [MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) |\n| [UnregisterWatcher](#namespacememory__advice_1aadc6ce04affd17246edbd853f5b02e63)`(MemoryAdvice_WatcherCallback callback)` | [MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) |\n| [watcher_callback](#namespacememory__advice_1a2b7efbe85e11a1016338a047fba2c05b)`(`[MemoryAdvice_MemoryState](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga33ecd5ed818cf6f8cefa3f63d1f998bb)` state, void *userData)` | `void` |\n\n| ### Classes ||\n|-------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|\n| [memory_advice::DefaultMetricsProvider](/reference/games/memory-advice/classmemory/advice-1-1-default-metrics-provider) | |\n| [memory_advice::DefaultPredictor](/reference/games/memory-advice/classmemory/advice-1-1-default-predictor) | |\n| [memory_advice::IMetricsProvider](/reference/games/memory-advice/classmemory/advice-1-1-i-metrics-provider) | Provides memory info from various metrics. |\n| [memory_advice::IPredictor](/reference/games/memory-advice/classmemory/advice-1-1-i-predictor) | A class to help predict memory limits using tensorflow lite models. |\n| [memory_advice::MemoryAdviceImpl](/reference/games/memory-advice/classmemory/advice-1-1-memory-advice-impl) | |\n| [memory_advice::StateWatcher](/reference/games/memory-advice/classmemory/advice-1-1-state-watcher) | |\n\n| ### Namespaces ||\n|----------------------------------------------------------------------------------------|---|\n| [memory_advice::utils](/reference/games/memory-advice/namespacememory/advice-1-1utils) | |\n\nFunctions\n---------\n\n### BaseTests\n\n```scdoc\nint32_t BaseTests()\n``` \n\n### GetAdvice\n\n```scdoc\nMemoryAdvice_ErrorCode GetAdvice(\n MemoryAdvice_JsonSerialization *advice\n)\n``` \n\n### GetAvailableMemory\n\n```scdoc\nint64_t GetAvailableMemory()\n``` \n\n### GetMemoryState\n\n```scdoc\nMemoryAdvice_MemoryState GetMemoryState()\n``` \n\n### GetPercentageAvailableMemory\n\n```text\nfloat GetPercentageAvailableMemory()\n``` \n\n### GetTotalMemory\n\n```scdoc\nint64_t GetTotalMemory()\n``` \n\n### Init\n\n```gdscript\nMemoryAdvice_ErrorCode Init(\n const char *params\n)\n``` \n\n### Init\n\n```scdoc\nMemoryAdvice_ErrorCode Init()\n``` \n\n### MemoryAdvice_JsonSerialization_Dealloc\n\n```scdoc\nvoid MemoryAdvice_JsonSerialization_Dealloc(\n MemoryAdvice_JsonSerialization *c\n)\n``` \n\n### RegisterWatcher\n\n```scdoc\nMemoryAdvice_ErrorCode RegisterWatcher(\n uint64_t intervalMillis,\n MemoryAdvice_WatcherCallback callback,\n void *user_data\n)\n``` \n\n### UnregisterWatcher\n\n```verilog\nMemoryAdvice_ErrorCode UnregisterWatcher(\n MemoryAdvice_WatcherCallback callback\n)\n``` \n\n### watcher_callback\n\n```scdoc\nvoid watcher_callback(\n MemoryAdvice_MemoryState state,\n void *userData\n)\n```"]]