Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of Memory error with MSFlexGrid

Status
Not open for further replies.

millerk

Programmer
Joined
Jul 5, 2002
Messages
133
Location
US
Hi,
I'm retrieving a recordset then using it to populate a MSFlexGrid. I keep getting an out of memory error. But it looks like I still have a little physical memory left and lots of virtual. Is there a limit to the size of an MSFlexGrid?

Here are my memory usage stats with my program running but before I get the rs and populate the grid:

Total Physical Memory: 261,616 KB
Available Physical Memory: 36,920 KB
Total Virtual Memory: 697,812 KB
Available Virtual Memory: 268,524 KB
Page File Space: 436,196 KB

Here is what my system info says after I start populating the grid and when I get the error.

Total Physical Memory: 261,616 KB
Available Physical Memory: 7,732 KB
Total Virtual Memory: 697,812 KB
Available Virtual Memory: 213,584 KB
Page File Space: 436,196 KB

My grid is 250 columns wide, and at the point of the memory error, it gets to about 1100 rows. So it's roughly 280,000 cells.

It seems to me like even if the physical is too low, it should just use virtual. Does this sound like a VB problem or a Windows problem. I'm on Win2K. I could just limit the amount of data the user gets at once, but I would really like to know why the virtual memory isn't being used.

Any help would be greatly appreciated.
Thanks,
Shanti
 

Actually, the grid is supposed to max out at 350,000 cells, which, in your case, would be about 1400 records.
However, you stated
"...it gets to about 1100 rows..."
So I am wondering if the number is actually higher internally.

Try limiting the recordset (SELECT TOP x) to 1000, 1100, 1200, 1300, etc. rows and see if it still works, and where the actual ceiling is. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
I saw something on MSDN that said the size was only limited by the amount of memory on the system. So this is incorrect? I can certainly limit the amount of data that is returned. I just didn't know there was a limit.

Thanks
 
I have never tested it but according to the information that I have it is which ever comes first: 350,000 or out of memory.

Try limiting the amount of records as I mentioned above to see where the grid is topping out at.... [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top