Click here to Skip to main content
15,439,966 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Out of Memory Exception in C++ Pin
David Crow10-Aug-17 3:19
MemberDavid Crow10-Aug-17 3:19 
AnswerRe: Out of Memory Exception in C++ Pin
divya0310-Aug-17 3:26
Memberdivya0310-Aug-17 3:26 
QuestionRe: Out of Memory Exception in C++ Pin
David Crow10-Aug-17 3:32
MemberDavid Crow10-Aug-17 3:32 
AnswerRe: Out of Memory Exception in C++ Pin
divya0310-Aug-17 17:24
Memberdivya0310-Aug-17 17:24 
AnswerRe: Out of Memory Exception in C++ Pin
jeron110-Aug-17 3:54
Memberjeron110-Aug-17 3:54 
GeneralRe: Out of Memory Exception in C++ Pin
divya0310-Aug-17 17:20
Memberdivya0310-Aug-17 17:20 
GeneralRe: Out of Memory Exception in C++ Pin
jeron111-Aug-17 4:21
Memberjeron111-Aug-17 4:21 
AnswerRe: Out of Memory Exception in C++ Pin
SeattleC++11-Aug-17 10:31
MemberSeattleC++11-Aug-17 10:31 
118Mb isn't all that big. You could easily hold it in memory. The map is costing you the size of the class plus about four pointers worth of storage for each entry. Perhaps your class stores the data very inefficiently. Perhaps you have a bug on reading in the data, like not recognizing end of file and adding endless entries until you run out of memory. Perhaps you have a memory leak.
  • How many rows are in the file? You can easily build a function to count rows using the current function that inputs data, but without saving the data.
  • How many rows are read in at the time the out-of-memory exception occurs? This and the last question might tell you if you had a bug inputting the data.
  • Are you using std::string to hold any of the row data, because memory costs can really add up when using std::string.
Maybe your representation is too expensive for the memory you have. You could approach this problem by reading in the file as a block, and building a data structure that puts pointers into the file block for each line, and then parse out a single line when you need one.
GeneralRe: Out of Memory Exception in C++ Pin
divya0313-Aug-17 19:03
Memberdivya0313-Aug-17 19:03 
GeneralRe: Out of Memory Exception in C++ Pin
SeattleC++14-Aug-17 5:03
MemberSeattleC++14-Aug-17 5:03 
AnswerRe: Out of Memory Exception in C++ Pin
leon de boer12-Aug-17 19:00
Memberleon de boer12-Aug-17 19:00 
GeneralRe: Out of Memory Exception in C++ Pin
SeattleC++14-Aug-17 4:54
MemberSeattleC++14-Aug-17 4:54 
AnswerRe: Out of Memory Exception in C++ Pin
S p k 52118-Aug-17 0:09
MemberS p k 52118-Aug-17 0:09 
Questionwhat is the value of y after the following statements? Pin
Member 133469949-Aug-17 9:30
MemberMember 133469949-Aug-17 9:30 
AnswerRe: what is the value of y after the following statements? Pin
Richard Deeming9-Aug-17 9:38
mveRichard Deeming9-Aug-17 9:38 
GeneralRe: what is the value of y after the following statements? Pin
«_Superman_»15-Aug-17 16:57
professional«_Superman_»15-Aug-17 16:57 
QuestionUSB eject notification Pin
john56328-Aug-17 2:59
Memberjohn56328-Aug-17 2:59 
AnswerRe: USB eject notification Pin
Jochen Arndt8-Aug-17 3:09
professionalJochen Arndt8-Aug-17 3:09 
GeneralRe: USB eject notification Pin
Munchies_Matt8-Aug-17 4:19
MemberMunchies_Matt8-Aug-17 4:19 
JokeRe: USB eject notification Pin
Randor 8-Aug-17 4:43
professional Randor 8-Aug-17 4:43 
GeneralRe: USB eject notification Pin
Daniel Pfeffer8-Aug-17 5:15
professionalDaniel Pfeffer8-Aug-17 5:15 
GeneralRe: USB eject notification Pin
Munchies_Matt8-Aug-17 6:57
MemberMunchies_Matt8-Aug-17 6:57 
GeneralRe: USB eject notification Pin
john56328-Aug-17 22:29
Memberjohn56328-Aug-17 22:29 
GeneralRe: USB eject notification Pin
Jochen Arndt8-Aug-17 23:43
professionalJochen Arndt8-Aug-17 23:43 
GeneralRe: USB eject notification Pin
john56329-Aug-17 2:01
Memberjohn56329-Aug-17 2:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.