Hi Olaf, svg-developers@yahoogroups.com wrote on 01/17/2007 03:47:42 PM:
> if have a very simple Batik App. It's not as simple as you think ;) > Starting this app with -Xms10m -Xmx64m runs into OutofMemory > Exception. When i remove the [second canvas]it works. > Any suggestions for this behaviour ? I suspect the problem is that 'setURI' is async. So the Threads that do the reading/parsing/building/rendering are keeping the canvases live a lot longer than you think. additionally by just removing the second canvas and not it's associated 200ms wait you give the first canvas an "extra" 200ms to complete and get out of the way. I should also say that likely the reason it is taking more than 400ms each to setup the first few canvases is because the JVM is just getting started, so it needs to read lots of class files and link them, as well as doing JIT compiling. Once it starts getting behind it just gets worse as each new canvas adds new threads. > public void startTestRender() { > for (int i = 0; i < 1000; i++) { > JSVGCanvas canvas1 = new JSVGCanvas(); > canvas1.setURI("your URL here"); > try { Thread.sleep(400); } catch (Exception ex) {} > > JSVGCanvas canvas2 = new JSVGCanvas(); > canvas2.setURI("other file here"); > System.out.println("" +i); > try { Thread.sleep(200); } catch (Exception ex) {} > } > } > > public static void main(String[] args) { > TestRenderer testrender = new TestRenderer(); > testrender.startTestRender(); > } > } > ---------------------------------------------------------- > ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/