Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 15 JUN 2009 05:14:45PM Don Muskopf wrote:

In experimenting with how OI deals with RAM limitations, I ran the following code to see how many variables, each with a size of 256MB, I could assign before OI gave an "out of memory" error.

    * Assign a string size of 256MB to each variable. 
    [/color]MB=Pwr([/color]2[/color],[/color]20[/color])   
    Count=MB * [/color]256 [/color]-[/color]1 
     
    [/color]LIST =Str( [/color]\00\[/color], Count ) 
    LIST2=Str( [/color]\00\[/color], Count ) 
    LIST3=Str( [/color]\00\[/color], Count ) 
    LIST4=Str( [/color]\00\[/color], Count ) 
[/color]*   LIST5=Str( \00\, Count )  ;* asigning this varible will Trigger a fatal "Out of Memory" error.[/color][/color][/size]         
               

The result was surprising.

My PC has 4GB of RAM. After subtracting the amount of memory on the video card, Task Manger shows 3,406 MB of total RAM available that can be addressed by the processor (Physical Memory). After starting OI, the Commit Charge (before executing the above code) is 477MB. Subtracting the Commit Charge from the Physical Memory available leaves about 2929MB of free RAM.

Given 2929MB of free RAM and each variable having a size of 256MB, you would think that you would be able to assign say at least 10 variables before you run out of RAM. But if I try to assign more than 4 of these variables, OI gives a fatal "Out of memory" error.

So with almost 3GB of free RAM, OI only seems to allow somewhere between 1GB and 1.2GB of RAM to be assigned to variables. Can someone help me understand this better? Does this apparent limitation apply to other aspects of OI memory management?

Thanks.


At 16 JUN 2009 05:38PM Bob Carten wrote:

Hi Don,

I'll look into it.

One workaround would be to use a .Net hashtable to hold any collection of large variables.

Google "System.Collections.HashTable" for methods and properties

Create as

ht=OleCreateInstance("System.Collections.HashTable")

OI 9.1 has a function RTI_HASHTABLE2 that is a wrapper around this object.


At 17 JUN 2009 09:45AM Don Muskopf wrote:

Hi Bob,

Thanks for the information. Speaking of hash tables, are there any memory limitations for RTP65 tables?


At 17 JUN 2009 10:57AM Bob Carten wrote:

]]Speaking of hash tables, are there any memory limitations for RTP65 tables?

OI 9.0 limits you to 32 RTP65 tables. Of course, each table can have many entries. In earlier versions I belive the limit is 10. I have not tested for memory limits. I started using the .Net collection because it can store OLE object references as well as strings.


At 17 JUN 2009 11:15AM cpates@sprezzatura.com wrote:

Don,

Under normal circumstances a 32-bit User mode program is only allowed 2GB of (virtual) memory to play with. This is for several reasons - a lot of them to do with backwards compatibility, and you probably won't get all of your 2GB that you think you should have due to other resources such as DLLs begin loaded etc.

If you really want to get into this I suggest that you take a look at Mark Russinovich's Blog where he's made some excellent postings regarding Windows memory limits.

cpates@sprezzatura.com

Captain's Blog

Battlestar Sprezzatura - BSG 77

Colonial leaders in all things RevSoft


At 17 JUN 2009 01:04PM Don Muskopf wrote:

Hi "Captain",

You're right, that was an excellent read. I'm going to go back and read it again more carefully later.

I have re-run the code I posted earlier several more times. Sometimes, it fails loading 5 variables (1.25GB), sometimes it fails loading 4 variables (1GB). At the time of failure, the Commit Charge in Task Manager ranges from 1.2 GB to 1.5 GB.

I'm not sure how much of this might be due Windows or a limitation in OI, but it seems apparent that if you have 4GB of RAM and a video card that takes away 768MB (like mine), then you play with fire if you allow OI to occupy more than 1GB of RAM ( or least allow OI to go over that limit because of variable assignments).


At 20 JUN 2009 04:43PM Don Muskopf wrote:

Bob,

FYI. I tried storing 256MB variables (records) in an RPT65 hash table. I received the same "Unrecoverable Engine Error / Out of Memory error" at roughly the same memory usage as when I was creating the variables (The Commit Charge at the time of the error this time was 1.5GB). So I'm guessing, that as Sprezz suggested, it may simply be a Windows memory limitation.


At 21 JUN 2009 12:43PM Bob Carten wrote:

Thanks Don ( and Sprezz )

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/2bdc1cf7a93c3f5e852575d60074b533.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1