View unanswered posts | View active topics It is currently Thu Oct 30, 2014 12:56 pm



Reply to topic  [ 7 posts ] 
 MFC - Out of memory? 
Author Message

Joined: Tue Nov 07, 2000 8:01 am
Posts: 11
Location: Urbana, Illinois, US
Post MFC - Out of memory?
Hey guys, it's been a looooong time since I've posted anything here. I have a problem with MFC now, and this is the best place to ask I'm sure [img]images/smiles/icon_smile.gif[/img] .. I need to load into memory a very very very large dataset, but for whatever reason MFC gives me an "out of memory" error whenever I try to do it. Is there anyway to get around this? I'm sure that I have enough RAM to deal with the size, and I don't know why MFC is doing this to me.. [img]images/smiles/icon_confused.gif[/img] Thanks

-Fredric


Wed May 26, 2004 12:45 pm
Profile ICQ WWW

Joined: Wed Sep 29, 1999 7:01 am
Posts: 59
Location: North Shore City, Auckland, New Zealand
Post MFC - Out of memory?
Which memory allocation function are you using? Just plain old 'new'?

[ May 26, 2004: Message edited by: Omen ]</p>


Wed May 26, 2004 11:20 pm
Profile WWW

Joined: Tue Nov 07, 2000 8:01 am
Posts: 11
Location: Urbana, Illinois, US
Post MFC - Out of memory?
Yup, just plain old new. Would malloc be better? =S

-Fredric


Thu May 27, 2004 3:24 pm
Profile ICQ WWW

Joined: Mon Sep 15, 2003 7:01 am
Posts: 4
Location: Texas
Post MFC - Out of memory?
This probably isn't the problem, but I'd use linked lists with a large amount of data like that, so the RAM doesn't have to be sequential.


Thu May 27, 2004 7:01 pm
Profile ICQ WWW

Joined: Wed Sep 29, 1999 7:01 am
Posts: 59
Location: North Shore City, Auckland, New Zealand
Post MFC - Out of memory?
Nah don't use malloc. Malloc doesn't know about constructors/destructors AFAIK.

*Unless* MFC has overloaded the operator new to do something else, then the fact that you're compiling and linking against MFC has nothing to do with why it would fail.

How is your data structured? How big is it?


Thu May 27, 2004 10:05 pm
Profile WWW

Joined: Sat Jun 05, 2004 7:01 am
Posts: 1
Location: 3rd planet from the sun
Post MFC - Out of memory?
MFC out of memory? Hah! I'd be suprised if it wasn't out of memory, it's so bloated :x


Wed Jun 16, 2004 11:55 am
Profile

Joined: Tue Aug 03, 2004 7:01 am
Posts: 4
Location: Yerevan, Armenia
Post MFC - Out of memory?
I'd suggest you not to use heap. Instead use memory mapped files. This will just map memory into your address space, but the handle (actually a pointer) points to system-wide virtual address (don't remember base), where DLLs and memory mapped files reside or it can be backuped by pagefile if you don't load your data from file(specify INVALID_HANDLE_VALUE for file handle in CreateFileMapping() API call).
I think in this way you can fix the problem, isolating it from MFC.


Thu Aug 05, 2004 11:41 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.