delphi 中关于 The DecisionCube capacity is low. Please deactivate dimensions or change the data set 错误的处理

本文解决了当物理内存与页面文件可用空间总和超过2GB时,DecisionCube出现的内存容量不足异常。通过修改GetAvailableMem函数来适配不同版本的Delphi编译器,并提供了一段具体的实现代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

描述
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. 请停用层面或更改数据集。
 
这个问题是在使用整数的函数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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值