Hi guys, I hope someone gives me new ideias. My problem is, as I can see, very strange. I've a new job and it's my first assignment, so I'm really concearnd about it. I've writen an aplication (Java classes, JSP pages) that creates, on demand, Charts for data base marketing. To make it simple, it gets some data from a database and draw Pie, Bar and Line charts - to make a visual presentation of the data. As a start, I've written a few classes, that get Maps. These maps represent the database data, and have as key String or Date objects that are the data labels, and as values Number objects that represent the numeric data. It works great, but if I hit "refresh" a few times (even just one time) Tomcat 4.1.24 starts using virtual memory up to 500MB and get shutdown by Windows 2000. I've tried making all methods synchronized, making all Maps syncronized, but I guess it's not a concurrency problem. My company uses Java 1.3.1_08, and I'm using JfreeChart to generate the Jpeg charts for me. Any ideias? I am not getting the data from the database yet, I'm populating the maps inside the JSP pages, for now.
<b><i>Bengt Hammarlund</i><br />� Sun Certified Java Programmer</b>
I'm actually concerned about being agressive when synchronizing. Before opening my mouth about it, I thought I'd google to be sure... I can't find a site anywhere that says synchronization helps memory usage. The concepts are pretty unrelated, as far as I know. Memory usage is about how many objects you have lying around. Synchronization is about who gets to use them and when and how.
As for fixing your memory problem, the standard replies fit in here. Make sure you don't create too many temporary objects. Do you have a memory 'leak' somewhere.. perhaps registering objects with a listener? How big are your images?
fyi: the company I work for uses jfreechart, and we've got a number of sites up and running with them, producing several dozen charts in any given minute interval during the business day. No real memory problems that I can recall.
Joined: Oct 17, 2003
Humm, thanks. I'm generating 500x300 pixels images, the default size. By the way, I have some questions on Jfreechart, since I don't have the documentation and it's Javadoc it's almost useless. How can I control the X labels on timeseries XY Charts? Do you actually work with JFreeChart... can you give me some hints? Thanks for any replys.