[mapguide-commits] r4349 - in sandbox/adsk/2.1:
Common/MapGuideCommon/Services Server/src/Common/Manager
Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Nov 19 18:16:39 EST 2009
Author: brucedechant
Date: 2009-11-19 18:16:38 -0500 (Thu, 19 Nov 2009)
New Revision: 4349
Modified:
sandbox/adsk/2.1/Common/MapGuideCommon/Services/ServerAdminDefs.cpp
sandbox/adsk/2.1/Common/MapGuideCommon/Services/ServerAdminDefs.h
sandbox/adsk/2.1/Server/src/Common/Manager/ServerManager.cpp
sandbox/adsk/2.1/Web/src/HttpHandler/HttpGetSiteInfo.cpp
Log:
Fix for trac ticket 971 - Memory leak cleanups
http://trac.osgeo.org/mapguide/ticket/971
Notes:
- Added constants for WorkingSet and VirtualMemory
Modified: sandbox/adsk/2.1/Common/MapGuideCommon/Services/ServerAdminDefs.cpp
===================================================================
--- sandbox/adsk/2.1/Common/MapGuideCommon/Services/ServerAdminDefs.cpp 2009-11-17 06:20:32 UTC (rev 4348)
+++ sandbox/adsk/2.1/Common/MapGuideCommon/Services/ServerAdminDefs.cpp 2009-11-19 23:16:38 UTC (rev 4349)
@@ -78,3 +78,5 @@
const STRING MgServerInformationProperties::OperatingSystemVersion = L"OperatingSystemVersion";
const STRING MgServerInformationProperties::ApiVersion = L"ApiVersion";
const STRING MgServerInformationProperties::MachineIp = L"MachineIp";
+const STRING MgServerInformationProperties::WorkingSet = L"WorkingSet";
+const STRING MgServerInformationProperties::VirtualMemory = L"VirtualMemory";
Modified: sandbox/adsk/2.1/Common/MapGuideCommon/Services/ServerAdminDefs.h
===================================================================
--- sandbox/adsk/2.1/Common/MapGuideCommon/Services/ServerAdminDefs.h 2009-11-17 06:20:32 UTC (rev 4348)
+++ sandbox/adsk/2.1/Common/MapGuideCommon/Services/ServerAdminDefs.h 2009-11-19 23:16:38 UTC (rev 4349)
@@ -175,6 +175,12 @@
/// Gets the operating system version
static const STRING OperatingSystemVersion; /// value("OperatingSystemVersion")
+
+ /// Gets the current memory working set
+ static const STRING WorkingSet; /// value("WorkingSet")
+
+ /// Gets the current virtual memory
+ static const STRING VirtualMemory; /// value("VirtualMemory")
};
Modified: sandbox/adsk/2.1/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- sandbox/adsk/2.1/Server/src/Common/Manager/ServerManager.cpp 2009-11-17 06:20:32 UTC (rev 4348)
+++ sandbox/adsk/2.1/Server/src/Common/Manager/ServerManager.cpp 2009-11-19 23:16:38 UTC (rev 4349)
@@ -529,9 +529,9 @@
BOOL ok = GetProcessMemoryInfo(procHandle, &counters, sizeof(counters));
if (ok)
{
- pProperty = new MgInt64Property(L"WorkingSet", counters.WorkingSetSize);
+ pProperty = new MgInt64Property(MgServerInformationProperties::WorkingSet, counters.WorkingSetSize);
pProperties->Add(pProperty);
- pProperty = new MgInt64Property(L"VirtualMemory", counters.PagefileUsage);
+ pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, counters.PagefileUsage);
pProperties->Add(pProperty);
}
#else
@@ -555,7 +555,7 @@
{
long kbytes = strtol(loc + strlen(strRss) + 1, &end, 10);
INT64 workingSet = kbytes * 1000;
- pProperty = new MgInt64Property(L"WorkingSet", workingSet);
+ pProperty = new MgInt64Property(MgServerInformationProperties::WorkingSet, workingSet);
pProperties->Add(pProperty);
}
@@ -565,7 +565,7 @@
{
long kbytes = strtol(loc + strlen(strSize) + 1, &end, 10);
INT64 workingSet = kbytes * 1000;
- pProperty = new MgInt64Property(L"VirtualMemory", workingSet);
+ pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, workingSet);
pProperties->Add(pProperty);
}
}
Modified: sandbox/adsk/2.1/Web/src/HttpHandler/HttpGetSiteInfo.cpp
===================================================================
--- sandbox/adsk/2.1/Web/src/HttpHandler/HttpGetSiteInfo.cpp 2009-11-17 06:20:32 UTC (rev 4348)
+++ sandbox/adsk/2.1/Web/src/HttpHandler/HttpGetSiteInfo.cpp 2009-11-19 23:16:38 UTC (rev 4349)
@@ -274,13 +274,13 @@
if (m_userInfo->GetApiVersion() == MG_API_VERSION(2,1,0))
{
xml += L"\t\t<WorkingSet>";
- int64Prop = (MgInt64Property*)properties->GetItem(L"WorkingSet");
+ int64Prop = (MgInt64Property*)properties->GetItem(MgServerInformationProperties::WorkingSet);
MgUtil::Int64ToString(int64Prop->GetValue(), tmpStr);
xml += MgUtil::MultiByteToWideChar(tmpStr);
xml += L"</WorkingSet>\n";
xml += L"\t\t<VirtualMemory>";
- int64Prop = (MgInt64Property*)properties->GetItem(L"VirtualMemory");
+ int64Prop = (MgInt64Property*)properties->GetItem(MgServerInformationProperties::VirtualMemory);
MgUtil::Int64ToString(int64Prop->GetValue(), tmpStr);
xml += MgUtil::MultiByteToWideChar(tmpStr);
xml += L"</VirtualMemory>\n";
More information about the mapguide-commits
mailing list