Subject:
|
Re: File Error - what does it exactly mean?
|
Newsgroups:
|
lugnet.robotics.nxt
|
Date:
|
Fri, 17 Aug 2007 21:39:28 GMT
|
Viewed:
|
24142 times
|
| |
| |
In lugnet.robotics.nxt, John Hansen wrote:
> In lugnet.robotics.nxt, Pavel Petrovic wrote:
> > But I am getting it when trying to allocate an array that is larger
> > than the amount of heap available.
>
> You've got 32k to work with for all variables of all types, including
> user-defined types and arrays. Every time you manipulate an array you use up
> more memory due to copying taking place in the VM.
>
> If you shared with me some information about your program I might be able to
> help you avoid excessive memory allocations. Email me and I'll try to help.
Well, I try to allocate all memory available for one big array and then deal
with it using my own memory manager with C-like calls of malloc and free. It
works fine, but I'd need to know how big this one array I can make while the
program still avoiding the File Error message. Other allocations I make are only
for retrieving/sending messages from BT and writing/reading data to file system.
Every once and then I get this message, because I add some more variables and
strings used in debug printouts in the program and then the arrinit fails and I
have to manually figure out what size is still ok... I'd like a feeback from
arrinit call that there's not enough memory instead of crashing the program.
|
|
Message is in Reply To:
| | Re: File Error - what does it exactly mean?
|
| (...) You've got 32k to work with for all variables of all types, including user-defined types and arrays. Every time you manipulate an array you use up more memory due to copying taking place in the VM. If you shared with me some information about (...) (17 years ago, 17-Aug-07, to lugnet.robotics.nxt)
|
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in NXT programmable brick
|
|
|
|