Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "Out of Memory" error

I have a VBA based model that creates very large arrays. It ran OK in nExcel
2002 and 2003, but the first time I tries to run it in Excel 2007 I got an
"Out of Memory" error. This appears to happen as memory is being allocated to
arrays when the simulation is first being initiated.

To try to isolate the problem, I created a very simple macro that does
nothing except create a 2-dimensional array:

Dim Array1() as single
Sub TestArray()
ReDim Array1(10000, 10000)
' Pause here using break point to check memory usage
in Task Manager
Erase Array1
End Sub

Increasing the array dimension too much above 10000 x 10000 results in the
"out of Memory" error. Prior to running the macro, Task Manager lists Excel
using about 27,000 K of memory.
Pausing the program part way with the array set at 10000 x 10000, Excel is
using 420,000 K. At 15000 x 11500, the memory usage was 740,000 K. At 15000
x 12000, I got the error.

I tried the same thing in Excel 2003 and got similar results, although with
a slightly larger array size before the error popped up.

It was my understanding that Excel 2002 and 2003 were limited to accessing a
maximum of 1 GB of RAM, while Excel 2007 was limited only by the physical
RAM. If that were the case, shouldn't my array size limits be much larger
running Excel 2007? Or is there still a memory size limit with VBA?

Old machine where my simulator worked: Pentium 4, 2 GB RAM, XP pro SP2,
Office 2003

New Machine where simulator encounters "Out of Memory" error: AMD Athlon
Dual Core, 4 GB RAM, XP Pro x64 SP2, Office 2007

Any thoughts?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default "Out of Memory" error

Excel isn't the tool for handling two dimensional arrays of 10000 by
10000.

Use MatLab, Mathematica, S, or APL (or J for Excel).

Excel is a presentation package with a backend Visual Scripting
language: VBA.

As to the fact that it worked in 2002 but not in 2007. Yeah, there are
many subtleties associated with building a C++ DLL and having that DLL
use memory like you want it to.

It could be that the 2002 Excel engine was 16 bit and 2007 is 32 bit.

But who cares? Excel isn't the tool for that job.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default "Out of Memory" error

wrote in message
...

Excel is a presentation package with a backend Visual Scripting
language: VBA.


LOL. IT department talk.

Best wishes Harald

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default "Out of Memory" error

I agree, I get this all the time from IT geeks.

--

Regards,
Nigel




"Harald Staff" wrote in message
...
wrote in message
...

Excel is a presentation package with a backend Visual Scripting
language: VBA.


LOL. IT department talk.

Best wishes Harald


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default "Out of Memory" error

Available memory in Excel 2007 is supposed to be limited by Windows XP.
This gives a theoretical 2GB of virtual memory, as compared to Excel 2003
which had a limit of 1GB of working set memory.
However in practical terms as you have found there does not seem to be much
difference in the size of things you can do.
Part of this lack of real improvement is caused by differences in
terminology (virtual memory is not the same as working set memory), part by
changes in the way Excel 2007 uses memory and part by increased size of
indexes for the big grid.

Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"CraigFarnden" wrote in message
...
I have a VBA based model that creates very large arrays. It ran OK in
nExcel
2002 and 2003, but the first time I tries to run it in Excel 2007 I got an
"Out of Memory" error. This appears to happen as memory is being allocated
to
arrays when the simulation is first being initiated.

To try to isolate the problem, I created a very simple macro that does
nothing except create a 2-dimensional array:

Dim Array1() as single
Sub TestArray()
ReDim Array1(10000, 10000)
' Pause here using break point to check memory
usage
in Task Manager
Erase Array1
End Sub

Increasing the array dimension too much above 10000 x 10000 results in the
"out of Memory" error. Prior to running the macro, Task Manager lists
Excel
using about 27,000 K of memory.
Pausing the program part way with the array set at 10000 x 10000, Excel is
using 420,000 K. At 15000 x 11500, the memory usage was 740,000 K. At
15000
x 12000, I got the error.

I tried the same thing in Excel 2003 and got similar results, although
with
a slightly larger array size before the error popped up.

It was my understanding that Excel 2002 and 2003 were limited to accessing
a
maximum of 1 GB of RAM, while Excel 2007 was limited only by the physical
RAM. If that were the case, shouldn't my array size limits be much larger
running Excel 2007? Or is there still a memory size limit with VBA?

Old machine where my simulator worked: Pentium 4, 2 GB RAM, XP pro SP2,
Office 2003

New Machine where simulator encounters "Out of Memory" error: AMD Athlon
Dual Core, 4 GB RAM, XP Pro x64 SP2, Office 2007

Any thoughts?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Instruction at "0x749860a0" referenced memory at "0x00000000" Tribeca Excel Discussion (Misc queries) 1 July 5th 08 12:41 AM
Runtime Error "7": Out of Memory Run Time Error 7 Excel Programming 0 November 10th 05 12:00 PM
Excel:Runtime Error 7 "Not enough Memory" with CreateObject (SAP.B sebastienm Excel Programming 0 July 24th 04 08:35 AM
too many external links give "Not Enough Memory" error lothario[_67_] Excel Programming 0 January 13th 04 04:03 AM
The instruction at "0x65255ac9" referenced memory at "0x00000008". The memory could not be read. Clikc OK to terminate etc Angus Comber[_2_] Excel Programming 1 November 7th 03 01:18 PM


All times are GMT +1. The time now is 09:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"