-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] Report the "actual" memory usage of the autodetect process #2846
base: main
Are you sure you want to change the base?
Conversation
Determine the actual memory usgae of the autodetect process as reported by the OS, e.g. on Linux this mould be the value of the maximum resident set size returned by a call to `getrusage`. Add this value to the model size stats record returned to the ES Java process so it can be included in the `job counts` tab for anomaly detection jobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ed. I did the first pass.
We should discuss the naming of the new field. While "actual" conveys the intention of the value, it is confusing to the user.
Also, does maximum resident set size actually correspond to the actual current memory usage or is it the historical peak process memory usage?
include/model/CResourceMonitor.h
Outdated
@@ -180,6 +181,8 @@ class MODEL_EXPORT CResourceMonitor { | |||
//! Returns the sum of used memory plus any extra memory | |||
std::size_t totalMemory() const; | |||
|
|||
std::size_t actualMemoryUsage() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can come up with something better than actualMemoryUsage
. Maybe: systemMemoryUsage
?
@@ -83,7 +84,8 @@ int main(int argc, char** argv) { | |||
ml::counter_t::E_TSADNumberMemoryLimitModelCreationFailures, | |||
ml::counter_t::E_TSADNumberPrunedItems, | |||
ml::counter_t::E_TSADAssignmentMemoryBasis, | |||
ml::counter_t::E_TSADOutputMemoryAllocatorUsage}; | |||
ml::counter_t::E_TSADOutputMemoryAllocatorUsage, | |||
ml::counter_t::E_TSADMaxResidentSetSize}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does reporting only the maximum resident set size make sense? Can we also collect the current resident set size?
The resident set size (RSS) represents the process's current RAM usage (so not counting pages that have been swapped out etc.), and the max RSS is the high water mark of that value. I think that reporting both would be useful for our purposes. |
* ActualMemory -> SystemMemory * Report current resident set size as well as max
|
Determine the actual memory usage of the autodetect process as reported by the OS, e.g. on Linux this would be the value of the maximum resident set size returned by a call to
getrusage
.Add this value to the model size stats record returned to the ES Java process so it can be included in the
job counts
tab for anomaly detection jobs.Relates elastic/elasticsearch#126256