Click here to Skip to main content
15,914,246 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
Falconapollo10-Jun-13 21:44
Falconapollo10-Jun-13 21:44 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
JackDingler11-Jun-13 4:24
JackDingler11-Jun-13 4:24 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
Falconapollo12-Jun-13 0:32
Falconapollo12-Jun-13 0:32 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
JackDingler12-Jun-13 4:45
JackDingler12-Jun-13 4:45 
AnswerRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
jschell10-Jun-13 9:17
jschell10-Jun-13 9:17 
AnswerRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
Stefan_Lang10-Jun-13 21:27
Stefan_Lang10-Jun-13 21:27 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
Falconapollo10-Jun-13 21:40
Falconapollo10-Jun-13 21:40 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
Stefan_Lang11-Jun-13 0:07
Stefan_Lang11-Jun-13 0:07 
Ok, there are probably several ways to solve this, but first let me clear up a misconception:

The amount of physical memory available to your computer does not limit the amount of memory available to your application. Therefore, forcing a library to not work on physical memory - if that were possible - wouldn't change a thing! It is the OS that decides where allocated objects reside, and, yes, that does include the hard disk. The OS already moves objects from physical memory to the hard disk if it is running low on physical memory. And it does that at runtime.

Your actual problem is that you are running out of virtual memory. Virtual memory is an abstract address space that the OS grants every application. Depending on your Windows version and settings, that address space may encompass anything between 2 and 3 GB at most, even if your machine has 16 GB of physical RAM.

There are two probable causes for your problem:
1. The amount of data you have to deal with is simply more than this library can handle.

If this is the problem, then you should consider ways how to partition your data into smaller chunks, and adapt your operations to process that data bit by bit. Loading a 4 GB file into memory simply does not work!

2. You may not be using the library as intended: many library functions create objects and return them as results. The intention is that you call appropriate destruction functions once you are finished with those objects. If you don't do that, the amount of memory you need will continually increase over time until you run out of memory. (and you may think it's the library that is the problem because the library does the allocation

You should check the library documentation to see which of the functions create objects and expect you to release those objecs again, or call corresponding functions that clean them up properly. Also check your algorithms to see whether they 'lock' these objects unnecessarily, or for too long.
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
Falconapollo11-Jun-13 0:21
Falconapollo11-Jun-13 0:21 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
JackDingler11-Jun-13 4:28
JackDingler11-Jun-13 4:28 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
SoMad10-Jun-13 22:11
professionalSoMad10-Jun-13 22:11 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
jschell11-Jun-13 8:37
jschell11-Jun-13 8:37 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
Falconapollo12-Jun-13 0:28
Falconapollo12-Jun-13 0:28 
AnswerRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
jschell11-Jun-13 8:43
jschell11-Jun-13 8:43 
GeneralRe: How to avoid thrid party lib(no source codes) to allocate memory from physical memory? Pin
Falconapollo12-Jun-13 0:29
Falconapollo12-Jun-13 0:29 
QuestionVC++ Convert file to base64 string and vice versa Pin
Member 84179548-Jun-13 8:34
Member 84179548-Jun-13 8:34 
AnswerRe: VC++ Convert file to base64 string and vice versa Pin
CPallini8-Jun-13 9:58
mveCPallini8-Jun-13 9:58 
AnswerRe: VC++ Convert file to base64 string and vice versa Pin
Richard MacCutchan8-Jun-13 21:43
mveRichard MacCutchan8-Jun-13 21:43 
Questionerror from using CString.GetBuffer (MAX_PATH), Pin
mrby1237-Jun-13 11:56
mrby1237-Jun-13 11:56 
AnswerRe: error from using CString.GetBuffer (MAX_PATH), Pin
jeron17-Jun-13 12:16
jeron17-Jun-13 12:16 
AnswerRe: error from using CString.GetBuffer (MAX_PATH), Pin
Richard MacCutchan7-Jun-13 22:21
mveRichard MacCutchan7-Jun-13 22:21 
QuestionRe: error from using CString.GetBuffer (MAX_PATH), Pin
David Crow8-Jun-13 3:19
David Crow8-Jun-13 3:19 
AnswerRe: error from using CString.GetBuffer (MAX_PATH), Pin
«_Superman_»9-Jun-13 5:04
professional«_Superman_»9-Jun-13 5:04 
QuestionAbstract Class Pin
AdvancedCPP7-Jun-13 3:24
AdvancedCPP7-Jun-13 3:24 
AnswerRe: Abstract Class Pin
Richard MacCutchan7-Jun-13 3:27
mveRichard MacCutchan7-Jun-13 3:27 

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.