Forum Discussion
Richard__Harlan
May 23, 2006Historic F5 Account
get_memory_usage_information
I have a script that is trying to get the memory used on the boxed. I am useing get_memory_usage_information I can get total memroy with out a problem just haveing a problem getting used_memory. From ...
May 23, 2006
I'd be careful about dropping the high 32 bits of those values. For memory it's probably OK as long as you don't have more than 4GB. A safer approach would be to build a native 64 bit value from the low and high components of our UInt64 structure.
my $total_memory = &build64($memory_info->{"total_memory"});
----------------------------------------------------------------------------
build64
----------------------------------------------------------------------------
sub build64()
{
($UInt64) = (@_);
$low = $UInt64->{"low"};
$high = $UInt64->{"high"};
For some reason this doesn't work...
$value64 = Math::BigInt->new($high)->blsft(32)->bxor($low);
$value64 = Math::BigInt->new(Math::BigInt->new($high)->blsft(32))->bxor($low);
return $value64;
}
I guess that's assuming you don't have 64bit support builtin (which isn't the default) and you have the Math::BigInt module on your system.
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects