Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
Samsy
Samsy's Profile
1
Posts
3
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
ArrayList and PImage Out Of Memory, Can anyone help me please ?
[7 Replies]
24-Aug-2013 06:34 PM
Forum:
Programming Questions
I'm trying to reproduce a webcam live stream with delay.
Actually, it works, but i run out of memory very fast.
Every 50 last frames are saved into an Array List.
When the arrayList size is over 50, i remove the first index.
I rapidly run out of memory.
Im pretty sure that when i remove an index, it doesnt delete the PImage from the memory.
Anynone can help me?
void draw() {
if (cam.available() == true) {
cam.read();
proc.add(cam.get());
image(proc.get(proc.size()-1),0,0);
if(proc.size()>=49)
{
image(proc.get(20),0,0);
image(proc.get(25),0,0);
image(proc.get(30),0,0);
image(proc.get(35),0,0);
image(proc.get(40),0,0);
image(proc.get(45),0,0);
}
if(proc.size() >= 50){
proc.remove(0);
}
}
}
«Prev
Next »
Moderate user : Samsy
Forum