OutOFMemoryError - Workaround Required
in
Programming Questions
•
2 years ago
Hi there,
I keep getting OutOFMemoryError messages when I am trying to work with files over approximately 75MB in this sketch. I have tested on Windows Vista x32 with 3GB RAM, and on Windows 7 x64 with 16GB RAM so it's clearly not an issue with the available memory. (Also I can't increase available memory above 1600MB in Processing Preferences or my sketches wont run on either system.) I haven't been able to find a solution to this problem. Can anyone offer insight as to why this is happening? My guess is it must be a limitation with Java's ability to access memory..? If anyone can suggest workarounds to this issue then I'd be very grateful.
Many Thanks.
I keep getting OutOFMemoryError messages when I am trying to work with files over approximately 75MB in this sketch. I have tested on Windows Vista x32 with 3GB RAM, and on Windows 7 x64 with 16GB RAM so it's clearly not an issue with the available memory. (Also I can't increase available memory above 1600MB in Processing Preferences or my sketches wont run on either system.) I haven't been able to find a solution to this problem. Can anyone offer insight as to why this is happening? My guess is it must be a limitation with Java's ability to access memory..? If anyone can suggest workarounds to this issue then I'd be very grateful.
Many Thanks.
- void setup(){
- byte[] data=loadBytes("input.mp3");
- for(int g=0;g<2;g++)
- {
- int gl=(int)random(128,data.length);
- data(gl)=(byte)random(255);
- }
- saveBytes("output.mp3",data);
- }
1