Skip to content

Commit

Permalink
Merge pull request #63 from stalleyj/memory
Browse files Browse the repository at this point in the history
Return -1 when unable to get memory value
  • Loading branch information
tobespc authored Oct 31, 2017
2 parents c5411c4 + aff281f commit b12f8ff
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ This project uses a semver-parsable X.0.Z version number for releases, where X i
Non-release versions of this project (for example on github.com/RuntimeTools/omr-agentcore) will use semver-parsable X.0.Z-dev.B version numbers, where X.0.Z is the last release with Z incremented and B is an integer. For further information on the development process go to the [appmetrics wiki][3]: [Developing](https://github.com/RuntimeTools/appmetrics/wiki/Developing).

## Version
3.2.5
3.2.6

## Release History
`3.2.6` - Bug fixes.
`3.2.5` - Bug fixes.
`3.2.4` - Node on z/OS support.
`3.2.3` - Swift 4 support.
Expand Down
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# "externalbinariesdir%": "<(PRODUCT_DIR)/deploy/external/binaries",
"externalbinariesdir%": "./plugins",
'build_id%': '.<!(["python", "./generate_build_id.py"])',
'coreversion%': '3.2.5',
'coreversion%': '3.2.6',
"conditions": [
['OS=="aix"', {
"portdir": "aix",
Expand Down
Binary file added libagentcore.dylib
Binary file not shown.
2 changes: 1 addition & 1 deletion src/ibmras/monitoring/agent/Agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ std::string Agent::getBuildDate() {
}

std::string Agent::getVersion() {
return "3.2.5";
return "3.2.6";
}

void Agent::setLogLevels() {
Expand Down
12 changes: 6 additions & 6 deletions src/ibmras/monitoring/plugins/common/memory/MemoryPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ int64 MemoryPlugin::getTotalPhysicalMemorySize() {
num_pages = sysconf(_SC_PHYS_PAGES);

if (pagesize == -1 || num_pages == -1) {
return 0;
return -1;
} else {
return (int64) pagesize *num_pages;
return (int64) pagesize * num_pages;
}
/*
* There is a bug in OSX Mavericks which may cause the compilation to fail
Expand All @@ -528,19 +528,19 @@ int64 MemoryPlugin::getTotalPhysicalMemorySize() {
int mib[2] = {CTL_HW, HW_MEMSIZE};
unsigned long physicalMemSize;
size_t len = sizeof(physicalMemSize);
if(!sysctl(mib, 2, &physicalMemSize, &len, NULL, 0)) {
if (!sysctl(mib, 2, &physicalMemSize, &len, NULL, 0)) {
return physicalMemSize;
}else {
} else {
aCF.logMessage(debug, strerror(errno));
return -1;
}
#elif defined(CTL_HW) && defined(HW_PHYSMEM) //32Bit
int mib[2] = {CTL_HW, HW_PHYSMEM};
unsigned long physicalMemSize;
size_t len = sizeof(physicalMemSize);
if(!sysctl(mib, 2, &physicalMemSize, &len, NULL, 0)) {
if (!sysctl(mib, 2, &physicalMemSize, &len, NULL, 0)) {
return physicalMemSize;
}else {
} else {
aCF.logMessage(debug, strerror(errno));
return -1;
}
Expand Down

0 comments on commit b12f8ff

Please sign in to comment.