Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Database/Decision Cube Controls    [ Add a report in this area ]  
Report #:  2703   Status: Closed
DecisionCube cannot be activated - 'The DecisionCube capacity is low' is reported, but incorrect
Project:  Delphi Build #:  any
Version:    7.0 Submitted By:   Robin Gerrets
Report Type:  Basic functionality failure Date Reported:  10/21/2002 8:05:25 AM
Severity:    Infrequently encountered problem Last Updated: 12/9/2004 1:04:44 PM
Platform:    All versions Internal Tracking #:  
Resolution: Duplicate (Resolution Comments) Resolved in Build: : 9.0.1761.24408
Duplicate of:  2303
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
If you have a lot of physical memory or a large page file, you may find that a DecisionCube raises the following exception whenever the DecisionCube's data set is opened:

Exception class: ELowCapacityError
Message: "The DecisionCube capacity is low. Please deactivate dimensions or change the data set."

As a result, the DecisionCube cannot be activated.
Steps to Reproduce:
Steps:
1. Open the DecisionCube's data set. This will trigger the bug.

The exception will occur whenever the sum of the available physical memory and the available page file memory exceeds 2 GBytes. This is caused by a bug in Delphi - more specifically: an integer being out of range in the procedure GetAvailableMem (unit Mxarrays).

Affected Delphi versions: Delphi 3-7
Workarounds
As a workaround, add a unit with the following code to your project:


{-------------------------------------------------------------------------------

        Bug workaround for 'The DecisionCube capacity is low' bug

________________________________________________________________________________

BUG DESCRIPTION
  If you have a lot of physical memory or a large page file, you may find that a
  DecisionCube raises the following exception whenever the DecisionCube's data
  set is opened:
    Exception class: ELowCapacityError
    Message: "The DecisionCube capacity is low. Please deactivate dimensions or
             change the data set."
  The exception will occur whenever the sum of the available physical memory and
  the available page file memory exceeds 2 GBytes. This is caused by a bug in
  Delphi - more specifically: an integer being out of range in the procedure
  GetAvailableMem (unit Mxarrays).

AFFECTED DELPHI VERSIONS
  Delphi 3-7 (with the DecisionCube package installed)

WORKAROUND
  Add this unit to your project.
-------------------------------------------------------------------------------}

unit DecisionCubeBugWorkaround;

interface

uses Windows, Mxarrays;

implementation

function GetAvailableMem: Integer;
const
  MaxInt: Int64 = High(Integer);
var
  MemStats: TMemoryStatus;
  Available: Int64;
begin
  GlobalMemoryStatus(MemStats);
  if (MemStats.dwAvailPhys > MaxInt) or (Longint(MemStats.dwAvailPhys) = -1) then
    Available := MaxInt
  else
    Available := MemStats.dwAvailPhys;
  if (MemStats.dwAvailPageFile > MaxInt) or (Longint(MemStats.dwAvailPageFile) = -1) then
    Inc(Available, MaxInt div 2)
  else
    Inc(Available, MemStats.dwAvailPageFile div 2);
  if Available > MaxInt then
    Result := MaxInt
  else
    Result := Available;
end;

initialization
  Mxarrays.SetMemoryCapacity(GetAvailableMem);
end.
Attachment
None
Comments

None

Server Response from: ETNACODE01