Stay organized with collections
Save and categorize content based on your preferences.
memory_advice::MemoryAdviceImpl
Summary
Public functions
|
BaseTests()
|
int32_t
Perform basic checking.
|
GenerateBaselineMetrics()
|
Json::object
Reads the baseline part of the advisor_parameters_ and reports metrics for those fields.
|
GenerateConstantMetrics()
|
Json::object
Reads the constant part of the advisor_parameters_ and reports metrics for those fields.
|
GenerateVariableMetrics()
|
Json::object
Reads the variable part of the advisor_parameters_ and reports metrics for those fields.
|
GetAdvice()
|
Json::object
Creates an advice object by reading variable metrics and feeding them into the provided machine learning model.
|
GetAvailableMemory()
|
int64_t
Evaluates information from the current metrics and returns an estimate for how much more memory is available, in bytes.
|
GetMemoryState()
|
Evaluates information from the current metrics and returns a memory state.
|
GetPercentageAvailableMemory()
|
float
Evaluates information from the current metrics and returns an estimate for how much more memory is available, as a percentage of the total memory.
|
GetTotalMemory()
|
int64_t
Returns the total memory of the device, as reported by ActivityManager::getMemoryInfo()
|
InitializationErrorCode() const
|
|
RegisterWatcher(uint64_t intervalMillis, MemoryAdvice_WatcherCallback callback, void *user_data)
|
Register watcher callback.
|
UnregisterWatcher(MemoryAdvice_WatcherCallback callback)
|
Unregister watcher callback.
|
Public functions
BaseTests
int32_t BaseTests()
GenerateBaselineMetrics
Json::object GenerateBaselineMetrics()
Reads the baseline part of the advisor_parameters_ and reports metrics for those fields.
GenerateConstantMetrics
Json::object GenerateConstantMetrics()
Reads the constant part of the advisor_parameters_ and reports metrics for those fields.
GenerateVariableMetrics
Json::object GenerateVariableMetrics()
Reads the variable part of the advisor_parameters_ and reports metrics for those fields.
GetAdvice
Json::object GetAdvice()
Creates an advice object by reading variable metrics and feeding them into the provided machine learning model.
GetAvailableMemory
int64_t GetAvailableMemory()
Evaluates information from the current metrics and returns an estimate for how much more memory is available, in bytes.
GetMemoryState
MemoryAdvice_MemoryState GetMemoryState()
Evaluates information from the current metrics and returns a memory state.
GetPercentageAvailableMemory
float GetPercentageAvailableMemory()
Evaluates information from the current metrics and returns an estimate for how much more memory is available, as a percentage of the total memory.
GetTotalMemory
int64_t GetTotalMemory()
Returns the total memory of the device, as reported by ActivityManager::getMemoryInfo()
RegisterWatcher
MemoryAdvice_ErrorCode RegisterWatcher(
uint64_t intervalMillis,
MemoryAdvice_WatcherCallback callback,
void *user_data
)
Register watcher callback.
UnregisterWatcher
MemoryAdvice_ErrorCode UnregisterWatcher(
MemoryAdvice_WatcherCallback callback
)
Unregister watcher callback.
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::MemoryAdviceImpl Class Reference\n\nmemory_advice::MemoryAdviceImpl\n===============================\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [MemoryAdviceImpl](#classmemory__advice_1_1_memory_advice_impl_1afda132b386ca2f57c28e0a6d73351524)`(const char *params, `[IMetricsProvider](/reference/games/memory-advice/classmemory/advice-1-1-i-metrics-provider#classmemory__advice_1_1_i_metrics_provider)` *metrics_provider, `[IPredictor](/reference/games/memory-advice/classmemory/advice-1-1-i-predictor#classmemory__advice_1_1_i_predictor)` *realtime_predictor, `[IPredictor](/reference/games/memory-advice/classmemory/advice-1-1-i-predictor#classmemory__advice_1_1_i_predictor)` *available_predictor)` ||\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [BaseTests](#classmemory__advice_1_1_memory_advice_impl_1a760c5dbf60a8eccc5dc31eddfeaa90f4)`()` | `int32_t` Perform basic checking. |\n| [GenerateBaselineMetrics](#classmemory__advice_1_1_memory_advice_impl_1a2fde855164ec98619f55b8695f53ecc9)`()` | `Json::object` Reads the baseline part of the advisor_parameters_ and reports metrics for those fields. |\n| [GenerateConstantMetrics](#classmemory__advice_1_1_memory_advice_impl_1a22d8b1d16bcb4b0177e86e2b919ab3bc)`()` | `Json::object` Reads the constant part of the advisor_parameters_ and reports metrics for those fields. |\n| [GenerateVariableMetrics](#classmemory__advice_1_1_memory_advice_impl_1a8884af858a5a37112302e1d7c38c6b71)`()` | `Json::object` Reads the variable part of the advisor_parameters_ and reports metrics for those fields. |\n| [GetAdvice](#classmemory__advice_1_1_memory_advice_impl_1aca5af0ad4d9405395a09716a41be08e4)`()` | `Json::object` Creates an advice object by reading variable metrics and feeding them into the provided machine learning model. |\n| [GetAvailableMemory](#classmemory__advice_1_1_memory_advice_impl_1af3673ed93889195e8e0ea4b27ec25749)`()` | `int64_t` Evaluates information from the current metrics and returns an estimate for how much more memory is available, in bytes. |\n| [GetMemoryState](#classmemory__advice_1_1_memory_advice_impl_1ad203d3a20c78f21c10c4ae82be7af3a3)`()` | [MemoryAdvice_MemoryState](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga33ecd5ed818cf6f8cefa3f63d1f998bb) Evaluates information from the current metrics and returns a memory state. |\n| [GetPercentageAvailableMemory](#classmemory__advice_1_1_memory_advice_impl_1a4030ad875c2d99cf5dd895e149a813df)`()` | `float` Evaluates information from the current metrics and returns an estimate for how much more memory is available, as a percentage of the total memory. |\n| [GetTotalMemory](#classmemory__advice_1_1_memory_advice_impl_1afb5dfc2f5c292d91d24d5ed66bbbb357)`()` | `int64_t` Returns the total memory of the device, as reported by ActivityManager::getMemoryInfo() |\n| [InitializationErrorCode](#classmemory__advice_1_1_memory_advice_impl_1abfea4103e918e232ed1b3bb75587c86e)`() const ` | [MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) |\n| [RegisterWatcher](#classmemory__advice_1_1_memory_advice_impl_1a87a87de723c6c43f675c9ef86bd730b2)`(uint64_t intervalMillis, MemoryAdvice_WatcherCallback callback, void *user_data)` | [MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) Register watcher callback. |\n| [UnregisterWatcher](#classmemory__advice_1_1_memory_advice_impl_1a98a64a6464fa29877826732ca06e95d2)`(MemoryAdvice_WatcherCallback callback)` | [MemoryAdvice_ErrorCode](/reference/games/memory-advice/group/memory-advice#group__memory__advice_1ga7061497339a50e977d400a58b8fb9f82) Unregister watcher callback. |\n\nPublic functions\n----------------\n\n### BaseTests\n\n```scdoc\nint32_t BaseTests()\n``` \nPerform basic checking. \n\n### GenerateBaselineMetrics\n\n```text\nJson::object GenerateBaselineMetrics()\n``` \nReads the baseline part of the advisor_parameters_ and reports metrics for those fields. \n\n### GenerateConstantMetrics\n\n```text\nJson::object GenerateConstantMetrics()\n``` \nReads the constant part of the advisor_parameters_ and reports metrics for those fields. \n\n### GenerateVariableMetrics\n\n```text\nJson::object GenerateVariableMetrics()\n``` \nReads the variable part of the advisor_parameters_ and reports metrics for those fields. \n\n### GetAdvice\n\n```text\nJson::object GetAdvice()\n``` \nCreates an advice object by reading variable metrics and feeding them into the provided machine learning model. \n\n### GetAvailableMemory\n\n```scdoc\nint64_t GetAvailableMemory()\n``` \nEvaluates information from the current metrics and returns an estimate for how much more memory is available, in bytes. \n\n### GetMemoryState\n\n```scdoc\nMemoryAdvice_MemoryState GetMemoryState()\n``` \nEvaluates information from the current metrics and returns a memory state. \n\n### GetPercentageAvailableMemory\n\n```text\nfloat GetPercentageAvailableMemory()\n``` \nEvaluates information from the current metrics and returns an estimate for how much more memory is available, as a percentage of the total memory. \n\n### GetTotalMemory\n\n```scdoc\nint64_t GetTotalMemory()\n``` \nReturns the total memory of the device, as reported by ActivityManager::getMemoryInfo() \n\n### InitializationErrorCode\n\n```gdscript\nMemoryAdvice_ErrorCode InitializationErrorCode() const \n``` \n\n### MemoryAdviceImpl\n\n```gdscript\n MemoryAdviceImpl(\n const char *params,\n IMetricsProvider *metrics_provider,\n IPredictor *realtime_predictor,\n IPredictor *available_predictor\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``` \nRegister watcher callback. \n\n### UnregisterWatcher\n\n```verilog\nMemoryAdvice_ErrorCode UnregisterWatcher(\n MemoryAdvice_WatcherCallback callback\n)\n``` \nUnregister watcher callback."]]