You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by narendragoyal <gi...@git.apache.org> on 2015/09/23 18:38:22 UTC
[GitHub] incubator-trafodion pull request: Fix for [TRAFODION-1492]
GitHub user narendragoyal opened a pull request:
https://github.com/apache/incubator-trafodion/pull/90
Fix for [TRAFODION-1492]
- Ignore if some properties are not found in the procfs
- Ability to disable memory monitoring in the SQL process by setting
SQL_DISABLE_MEMMONITOR to 1 in $MY_SQROOT/etc/ms.env
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/narendragoyal/incubator-trafodion trafodion_1492
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/90.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #90
----
commit 89a3ac4d17f1a9cee9ac6a1e53813e6cc7902d26
Author: Narendra Goyal <ng...@dev01.trafodion.org>
Date: 2015-09-23T16:32:34Z
Fix for [TRAFODION-1492]
- Ignore if some properties are not found in the procfs
- Ability to disable memory monitoring in the SQL process by setting
SQL_DISABLE_MEMMONITOR to 1 in $MY_SQROOT/etc/ms.env
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request: Fix for [TRAFODION-1492]
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-trafodion/pull/90
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request: Fix for [TRAFODION-1492]
Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/90#discussion_r40235469
--- Diff: core/sql/cli/memorymonitor.cpp ---
@@ -105,14 +105,32 @@ MemoryMonitor::MemoryMonitor(Lng32 windowSize,
char *currPtr;
size_t bytesRead;
fd_meminfo_ = fopen("/proc/meminfo", "r");
- bytesRead = fread(buffer, 1, 1024, fd_meminfo_);
- currPtr = strstr(buffer, "MemTotal");
- sscanf(currPtr, "%*s " PF64 " kB", &memTotal_);
- physKBytes_ = memTotal_;
- physKBytesRatio_ = physKBytes_ / (8 * 1024 * 1024);
- fd_vmstat_ = fopen("/proc/vmstat", "r");
+ if (fd_meminfo_) {
+ bytesRead = fread(buffer, 1, 1024, fd_meminfo_);
+ currPtr = strstr(buffer, "MemTotal");
+ if (currPtr) {
+ sscanf(currPtr, "%*s " PF64 " kB", &memTotal_);
+ physKBytes_ = memTotal_;
+ physKBytesRatio_ = physKBytes_ / (8 * 1024 * 1024);
+ }
+ else {
+ // something unexpected. let's just close the file
+ fclose(fd_meminfo_);
+ fd_meminfo_ = 0;
+ }
+ }
- ULng32 pageSize = 0;
+ // Disable monitoring if the envvar is set.
+ // We do this here to get the initial meminfo when the
--- End diff --
Incomplete comment?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-trafodion pull request: Fix for [TRAFODION-1492]
Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/90#discussion_r40235832
--- Diff: core/sql/cli/memorymonitor.cpp ---
@@ -105,14 +105,32 @@ MemoryMonitor::MemoryMonitor(Lng32 windowSize,
char *currPtr;
size_t bytesRead;
fd_meminfo_ = fopen("/proc/meminfo", "r");
- bytesRead = fread(buffer, 1, 1024, fd_meminfo_);
- currPtr = strstr(buffer, "MemTotal");
- sscanf(currPtr, "%*s " PF64 " kB", &memTotal_);
- physKBytes_ = memTotal_;
- physKBytesRatio_ = physKBytes_ / (8 * 1024 * 1024);
- fd_vmstat_ = fopen("/proc/vmstat", "r");
+ if (fd_meminfo_) {
+ bytesRead = fread(buffer, 1, 1024, fd_meminfo_);
+ currPtr = strstr(buffer, "MemTotal");
+ if (currPtr) {
+ sscanf(currPtr, "%*s " PF64 " kB", &memTotal_);
+ physKBytes_ = memTotal_;
+ physKBytesRatio_ = physKBytes_ / (8 * 1024 * 1024);
+ }
+ else {
+ // something unexpected. let's just close the file
+ fclose(fd_meminfo_);
+ fd_meminfo_ = 0;
+ }
+ }
--- End diff --
physKBytesRatio_ doesn't seem to have an initializer so it will be uninitialized in some code paths. Could we add one?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---