Below is the list of changes that have just been committed into a local
6.0 repository of cpowers. When cpowers does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-11-02 01:38:30-05:00, chris@stripped +2 -0
Bug#31967, "Falcon: hang changing falcon_record_memory_max"
Enforce upper limit of falcon_record_memory_max to that of physical memory.
storage/falcon/Configuration.cpp@stripped, 2007-11-02 01:38:28-05:00, chris@stripped
+24 -8
Configuration::setRecordMemoryMax() imposes upper limit of
falcon_record_memory_max to that of physical system memory.
storage/falcon/Configuration.h@stripped, 2007-11-02 01:38:28-05:00, chris@stripped +1
-1
Configuration::setRecordMemoryMax() imposes upper limit of
falcon_record_memory_max to that of physical system memory.
diff -Nrup a/storage/falcon/Configuration.cpp b/storage/falcon/Configuration.cpp
--- a/storage/falcon/Configuration.cpp 2007-10-23 15:50:14 -05:00
+++ b/storage/falcon/Configuration.cpp 2007-11-02 01:38:28 -05:00
@@ -297,9 +297,10 @@ int64 Configuration::getMemorySize(const
return n;
}
-int64 Configuration::getAvailablePhysicalMemory()
+uint64 Configuration::getPhysicalMemory(uint64 *available, uint64 *total)
{
- int64 availableMemory = 0;
+ uint64 availableMemory = 0;
+ uint64 totalMemory = 0;
#ifdef _WIN32
MEMORYSTATUSEX stat;
@@ -309,7 +310,10 @@ int64 Configuration::getAvailablePhysica
stat.dwLength = sizeof(stat);
if (GlobalMemoryStatusEx(&stat) != 0)
+ {
availableMemory = stat.ullAvailPhys;
+ totalMemory = stat.ullTotalPhys;
+ }
else
error = GetLastError();
@@ -334,15 +338,24 @@ int64 Configuration::getAvailablePhysica
availableMemory *= ONE_MB;
*/
#else
- int32 pageSize = sysconf(_SC_PAGESIZE);
- //int32 physPages = sysconf(_SC_PHYS_PAGES);
- int32 avPhysPages = sysconf(_SC_AVPHYS_PAGES);
+ int64 pageSize = (int64)sysconf(_SC_PAGESIZE);
+ int64 physPages = (int64)sysconf(_SC_PHYS_PAGES);
+ int64 avPhysPages = (int64)sysconf(_SC_AVPHYS_PAGES);
- if ((pageSize > 0) && (avPhysPages > 0))
- availableMemory = (pageSize * avPhysPages);
+ if (pageSize > 0 && physPages > 0 && avPhysPages > 0)
+ {
+ availableMemory = (uint64)(pageSize * avPhysPages);
+ totalMemory = (uint64)(pageSize * physPages);
+ }
#endif
- return availableMemory;
+ if (available)
+ *available = availableMemory;
+
+ if (total)
+ *total = totalMemory;
+
+ return totalMemory;
}
@@ -395,7 +408,10 @@ void Configuration::setRecordScavengeFlo
void Configuration::setRecordMemoryMax(uint64 value)
{
+ uint64 totalMemory = getPhysicalMemory();
+
recordMemoryMax = MAX(value, MIN_RECORD_MEMORY);
+ recordMemoryMax = MIN(value, totalMemory);
setRecordScavengeThreshold(recordScavengeThresholdPct);
diff -Nrup a/storage/falcon/Configuration.h b/storage/falcon/Configuration.h
--- a/storage/falcon/Configuration.h 2007-10-23 15:50:14 -05:00
+++ b/storage/falcon/Configuration.h 2007-11-02 01:38:28 -05:00
@@ -34,7 +34,7 @@ public:
void release();
void addRef();
int64 getMemorySize(const char *string);
- int64 getAvailablePhysicalMemory();
+ uint64 getPhysicalMemory(uint64 *available = NULL, uint64 *total = NULL);
bool getLine(void *file, int length, char *line);
void setRecordScavengeThreshold(int threshold);
void setRecordScavengeFloor(int floor);
| Thread |
|---|
| • bk commit into 6.0 tree (chris:1.2665) BUG#31967 | cpowers | 2 Nov |