描述
when the sum of the physical memory and the available page file memory exceeds 2 GBytes, then the DecisionCube raises the following exception: 当总和的物理内存和页面文件可存储超过2 GBytes ,然后DecisionCube提出了以下异常:
The DecisionCube capacity is low. 该DecisionCube能力低。 Please deactivate dimensions or change the data set. 请停用层面或更改数据集。
The DecisionCube capacity is low. 该DecisionCube能力低。 Please deactivate dimensions or change the data set. 请停用层面或更改数据集。
这个问题是在使用整数的函数GetAvailableMem ,我解决这个,这个单位加入到该项目中。
*********************************************************************************************************************************
unit DecisionCubeBugWorkaround;
interface
uses Windows, Mxarrays;
implementation
function GetAvailableMem: Integer;
const
//MaxInt: Int64 = High(Integer); if Upper than 3 Delphi Version
MaxInt = High(Integer);
var
MemoryStatus: TMemoryStatus;
//AvailableMem: Int64; if Upper than 3 Delphi Version
AvailableMem: LongInt;
begin
MemoryStatus.dwLength :=SizeOf(MemoryStatus);
GlobalMemoryStatus(MemoryStatus);
AvailableMem:= MemoryStatus.dwAvailPhys;
if AvailableMem >= 0 then
AvailableMem:= AvailableMem + MemoryStatus.dwAvailPageFile;
if AvailableMem < 0 then
Result := MaxInt
else
Result := AvailableMem;
end;
initialization
Mxarrays.SetMemoryCapacity(GetAvailableMem);
end.
unit DecisionCubeBugWorkaround;
interface
uses Windows, Mxarrays;
implementation
function GetAvailableMem: Integer;
const
//MaxInt: Int64 = High(Integer); if Upper than 3 Delphi Version
MaxInt = High(Integer);
var
MemoryStatus: TMemoryStatus;
//AvailableMem: Int64; if Upper than 3 Delphi Version
AvailableMem: LongInt;
begin
MemoryStatus.dwLength :=SizeOf(MemoryStatus);
GlobalMemoryStatus(MemoryStatus);
AvailableMem:= MemoryStatus.dwAvailPhys;
if AvailableMem >= 0 then
AvailableMem:= AvailableMem + MemoryStatus.dwAvailPageFile;
if AvailableMem < 0 then
Result := MaxInt
else
Result := AvailableMem;
end;
initialization
Mxarrays.SetMemoryCapacity(GetAvailableMem);
end.
本文解决了当物理内存与页面文件可用空间总和超过2GB时,DecisionCube出现的内存容量不足异常。通过修改GetAvailableMem函数来适配不同版本的Delphi编译器,并提供了一段具体的实现代码。
699

被折叠的 条评论
为什么被折叠?



