FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Software Bugs
(Moderator: fry)
   object finalisation
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: object finalisation  (Read 682 times)
benelek

35160983516098 WWW Email
object finalisation
« on: Apr 12th, 2003, 10:07am »

does Processing finalise the objects created within a sketch, once the sketch has been stopped?
 
i don't think i'm the first one to bring this up, but when i run a sketch over an over again, the memory allocation of Processing seems to keep increasing. even after running a small 5-line sketch 10 times, the memory usage of Processing increases by 3mb. after a while i find P5's using over 80mb, and i wonder why my computer's running so slow...
 
i know this kind of thing doesnt happen when reloading an exported applet by pressing 'refresh' on my browser, so can this be attributed to the java-within-java situation of the p5 environment? are objects just left lying about, instead of finalisation?
 
-jacob
 
fry


WWW
Re: object finalisation
« Reply #1 on: Apr 13th, 2003, 1:32am »

the classes are left floating around. we destroy references to them and have to hope that the jvm will release them. so there's either a dangling reference around there somewhere that's keep the class (and all its images, etc) around, or the jvm stinks. both are (equally?) likely, though i'll look into the former.
 
how much of an issue is this low memory thing for folks? i have it as a low priority right now, but having received multiple reports on the issue, that could be adjusted.
 
that is, does it prevent work from happening (like the caret being busted) or is it along the lines of "well, it's alpha software, and not terribly surprising." and can wait till the beta phase of bug-cleaning?
 
skloopy

WWW
Re: object finalisation
« Reply #2 on: Apr 13th, 2003, 2:04am »

It hasn't stopped any of my sketches from working, but very often I have to quit the program after every time i run a sketch. Some times P5 runs out of memory so fast that it won't even save the file and I have to copy and paste it into BBedit and then restart p5.
 
pollux

WWW Email
Re: object finalisation
« Reply #3 on: May 5th, 2003, 8:11pm »

there's already a thread on that subject at
 
http://proce55ing.net/discourse/yabb/board_Proce55ing_software__bugs_action_display_num_1043415992.html
 
also, if it's useful:
 
i usually save as... some of my sketches, for versioning them up, but when i do that, it creates on the applet folder, classes also for prior versions of the sketch, so if i create thingie02 from thingie01 and i had the foo class on it, i get two files, one thingie01$foo.class and thingie02$foo.class on the thingie02 applet folder. so i started wondering if the applet when inside P5 loads both(all) the classes, and since there's no reference for one(some) of them, keeps everything in memory... (but i don't know what i'm saying, folks)
« Last Edit: May 5th, 2003, 8:13pm by pollux »  

pollux | www.frwrd.net
fry


WWW
Re: object finalisation
« Reply #4 on: May 6th, 2003, 1:20am »

on Apr 13th, 2003, 2:04am, ScloopDogg wrote:
It hasn't stopped any of my sketches from working, but very often I have to quit the program after every time i run a sketch. Some times P5 runs out of memory so fast that it won't even save the file and I have to copy and paste it into BBedit and then restart p5.

yikes.. is this on image-heavy applets at least or just about anything and are you on os9 or osx (sounds like os9..)
 
fry


WWW
Re: object finalisation
« Reply #5 on: May 6th, 2003, 1:21am »

on May 5th, 2003, 8:11pm, pollux wrote:

i usually save as... some of my sketches, for versioning them up, but when i do that, it creates on the applet folder, classes also for prior versions of the sketch, so if i create thingie02 from thingie01 and i had the foo class on it, i get two files, one thingie01$foo.class and thingie02$foo.class on the thingie02 applet folder. so i started wondering if the applet when inside P5 loads both(all) the classes, and since there's no reference for one(some) of them, keeps everything in memory... (but i don't know what i'm saying, folks)

the thingie01$foo.class is getting copied since the save as copies everything from the folder, but it won't be loaded when you run the new version of the sketch (post save-as). however.. i think the previous version (pre-save-as) is being kept around in memory.. which is part of what's causing so much trouble for folks.
 
skloopy

WWW
Re: object finalisation
« Reply #6 on: May 6th, 2003, 8:40am »

on May 6th, 2003, 1:20am, fry wrote:
yikes.. is this on image-heavy applets at least or just about anything and are you on os9 or osx (sounds like os9..)

 
It mostly happens with applets that load large images or even just a few small images and text sometimes. I was working on a sketch that loads just one html file and it would only load it a few times before running out of RAM. It wasn't even that big, just a normal HTML page. Even on the image heave app, it's only loading a 360x2000 (roughly) image and then looping through the image.pixels[], so it shouldn't use that much ram.
 
Yeah i'm on OS9. I'd use X but it's graphics engine is much too slow. It slows P5 sketches way down and makes applets that use the native java graphics crawl, because of the anti-aliasing.
 
fry


WWW
Re: object finalisation
« Reply #7 on: May 6th, 2003, 5:38pm »

yeah, so this will be half p5's fault and half the fault of mrj. at any rate, we're trying to fix it all, so at least we can confidently blame problems on mrj and know that p5 is less of a hog on its own.
 
Pages: 1 

« Previous topic | Next topic »