Hello,
It seems like I bumped up to the memory limit of the board. It say "The Netburner board has insufficient RAM to complete this operation."
When I build, it says I have used 7.7% of the RAM and 10% (or so) of flash; way below the limit. I am including a bunch of header files from the Netburner library, and creating a few objects during runtime. I don't see how I can exhaust all 8M though....
This seemed to have started after I declared a handful of floats in one of my classes and added two short, simple methods.
Any ideas?
Thanks!
Christoph
insufficient ram
Re: insufficient ram
I take it this isn't a trivial problem or a lot of information.
I will try and hard reset the board to see if it was just a fluke. Other than that, I would assume most memory is allocated during compile time, and only objects created during runtime (bla* foo = new bla()) would increase the ram usage during runtime. There are only three objects that are instantiated once and are kept around for the lifetime of the application, since they do all the work, and neither has any large member variables or anything.
Any hints or leads you guys can give me?
Thanks!
Christoph
I will try and hard reset the board to see if it was just a fluke. Other than that, I would assume most memory is allocated during compile time, and only objects created during runtime (bla* foo = new bla()) would increase the ram usage during runtime. There are only three objects that are instantiated once and are kept around for the lifetime of the application, since they do all the work, and neither has any large member variables or anything.
Any hints or leads you guys can give me?
Thanks!
Christoph
Re: insufficient ram
You have to give us more to work with! Code snippets, or something.
People here are very helpful, but you got to give them something to work with...
Cheers
People here are very helpful, but you got to give them something to work with...
Cheers
Re: insufficient ram
Alright, looks like it was a glitch. I couldn't even load the telnettest demo on it, got the same error message. I went into the board and flashed it from the monitor with the telnettest demo, which worked. Afterwards I could normally flash my actual app onto the board without problems.
Will let you guys know if there are any more problems.
Sorry for not posting code, but I'm not sure if I can release it.
Thanks again!!
Christoph
Will let you guys know if there are any more problems.
Sorry for not posting code, but I'm not sure if I can release it.
Thanks again!!
Christoph
Re: insufficient ram
Are you doing a bunch of malloc, or new's in the code ?
You may be using up the dynamic memory pool.
The autoupdate out of memory error message says it could not malloc a block of ram big enough to hold the image.
Paul
You may be using up the dynamic memory pool.
The autoupdate out of memory error message says it could not malloc a block of ram big enough to hold the image.
Paul
Re: insufficient ram
you might want to call spaceleft() in your update_shutdown_func
so that you can control the update process and free malloc-ed
space if needed first.
so that you can control the update process and free malloc-ed
space if needed first.
Re: insufficient ram
Guys,
No, just three new's for the objects that do all the work. I don't think they need to be deallocated, since I want them around all the time. Even during AutoUpdate, it should free up the memory on restart, right? Or what happens if the current app uses all of the RAM, and I try to AutoUpdate? Will it give this error message?
I have no update_shutdown_func in my code. Where do I add it?
Thanks! Like I said, it works now, so maybe it was a fluke.
Christoph
No, just three new's for the objects that do all the work. I don't think they need to be deallocated, since I want them around all the time. Even during AutoUpdate, it should free up the memory on restart, right? Or what happens if the current app uses all of the RAM, and I try to AutoUpdate? Will it give this error message?
I have no update_shutdown_func in my code. Where do I add it?
Thanks! Like I said, it works now, so maybe it was a fluke.
Christoph
Re: insufficient ram
If AutoUpdate succeeds, it reboots the device, so yes you could say that memory is freed. If your app exhausts all the memory on the board, most likely nothing will work after that and you are going to crash.ckoehler wrote:Guys,
No, just three new's for the objects that do all the work. I don't think they need to be deallocated, since I want them around all the time. Even during AutoUpdate, it should free up the memory on restart, right? Or what happens if the current app uses all of the RAM, and I try to AutoUpdate? Will it give this error message?
I have no update_shutdown_func in my code. Where do I add it?
Thanks! Like I said, it works now, so maybe it was a fluke.
Christoph
For AutoUpdate to succeed there must be enough ram available to download the entire compressed image. It is not until this happens and the checksum matches that the image is written to flash.
Re: insufficient ram
Autoupdate has a callback function that is called right before an update begins called update_shutdown_func. You can see an example of this being used in the example C:\nburn\examples\AutoUpdateFeatures. This callback function is called before the system tries to malloc space for the update. You should free any dynamic memory with this callback function to make space in RAM for the autoupdate.