Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Out of memory panic
Out of memory panic [message #35223] Mon, 23 January 2012 21:22 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
I am getting the "out of memory" log message and application crash quite often. Would it be possible for this message to print the total occupied RAM by the application before the call to new and the size of the requested block that caused the crash.

And I am using some DLLs. Should I use the USE_MALLOC flag?

[Updated on: Mon, 23 January 2012 21:25]

Report message to a moderator

Re: Out of memory panic [message #35229 is a reply to message #35223] Tue, 24 January 2012 08:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 23 January 2012 15:22

I am getting the "out of memory" log message and application crash quite often. Would it be possible for this message to print the total occupied RAM by the application before the call to new and the size of the requested block that caused the crash.



I can try... I cannot guarantee this is possible.

Quote:


And I am using some DLLs. Should I use the USE_MALLOC flag?


Well, it definitely worth a try. With DLLs, there is always chances that our new/delete overloads get mixed with system new/delete, especially if library is C++ based...
Re: Out of memory panic [message #35233 is a reply to message #35223] Tue, 24 January 2012 10:00 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
cbpporter wrote on Mon, 23 January 2012 21:22


....
And I am using some DLLs. Should I use the USE_MALLOC flag?



That's almost for sure the problem.
I'm using OCE library which does custom allocation and has *many* allocation bugs that clashes completely with Upp custom allocators.

If your DLL allocates something and you deallocate it in Upp, or the way around, you'll have problems for sure.
You'll have problems anyways if your DLL uses custom allocation different from malloc()/free()... the right approach would be to *not* manage the same memory on both sides, which is quite difficult sometimes.

Max
Re: Out of memory panic [message #35234 is a reply to message #35229] Tue, 24 January 2012 10:06 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
mirek wrote on Tue, 24 January 2012 09:33

cbpporter wrote on Mon, 23 January 2012 15:22

I am getting the "out of memory" log message and application crash quite often. Would it be possible for this message to print the total occupied RAM by the application before the call to new and the size of the requested block that caused the crash.



I can try... I cannot guarantee this is possible.



Thank you! It needs to be pure informative. If I have 400 MiBs used and I allocate 10 more and it runs out of memory there is probably some other cause, maybe something with the DLL. If I allocate another 200 and I did not mean too then clearly my code is all wrong.

Most of the times when this panic message triggers I am sitting at around 300 MiBs.
Re: Out of memory panic [message #35235 is a reply to message #35233] Tue, 24 January 2012 10:10 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
mdelfede wrote on Tue, 24 January 2012 11:00

cbpporter wrote on Mon, 23 January 2012 21:22


....
And I am using some DLLs. Should I use the USE_MALLOC flag?



That's almost for sure the problem.
I'm using OCE library which does custom allocation and has *many* allocation bugs that clashes completely with Upp custom allocators.

If your DLL allocates something and you deallocate it in Upp, or the way around, you'll have problems for sure.
You'll have problems anyways if your DLL uses custom allocation different from malloc()/free()... the right approach would be to *not* manage the same memory on both sides, which is quite difficult sometimes.

Max



Thanks! In my case parts of the memory are shared with the GPU also. I'll try the flag.

The code is already very CPU capped so I guess it wouldn't hurt if I implement a memory chunk pooler since I am loosing the U++ allocator. Most of the times I have to allocate hundreds of KiB every 50 miliseconds and this probably is not the fastest operation.
Re: Out of memory panic [message #35236 is a reply to message #35235] Tue, 24 January 2012 11:02 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

I do not know if you use 32-bit Windows or not, but if you do and need larger memory space available for the application, I suggest you add this linker option to your package: /LARGEADDRESSAWARE . I was crashing at out-of-memory condition at around 1GB until I figured this one out.

Best regards,

Tom
Re: Out of memory panic [message #35259 is a reply to message #35223] Thu, 26 January 2012 20:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
cbpporter wrote on Mon, 23 January 2012 15:22

I am getting the "out of memory" log message and application crash quite often. Would it be possible for this message to print the total occupied RAM by the application before the call to new and the size of the requested block that caused the crash.



Done.
Re: Out of memory panic [message #35265 is a reply to message #35259] Fri, 27 January 2012 10:35 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
mirek wrote on Thu, 26 January 2012 21:25

cbpporter wrote on Mon, 23 January 2012 15:22

I am getting the "out of memory" log message and application crash quite often. Would it be possible for this message to print the total occupied RAM by the application before the call to new and the size of the requested block that caused the crash.



Done.

Thank you! Code looks OK.

After I get my next panic message I'll tell you if the information is useful.
Re: Out of memory panic [message #35402 is a reply to message #35265] Fri, 10 February 2012 13:31 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
PANIC: Out of memory!
Requested size: 1535040
U++ allocated memory: 1750712 KB


I guess it works fine! Thank you very much!

BTW: The requested size is in bytes?
Re: Out of memory panic [message #35403 is a reply to message #35402] Fri, 10 February 2012 13:46 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes, it is in bytes. I will add B there to avoid confusion...
Previous Topic: TextSettings update
Next Topic: Json serialization support
Goto Forum:
  


Current Time: Fri Mar 29 15:26:59 CET 2024

Total time taken to generate the page: 0.01625 seconds