My guess would be the JFreeChart crashing your server. Unless you have
implemented the DataProvider in a wrong way it should only load
visible items (one page). But the JFreeChart is probably loading
entire dataset. You should consider generating the chart and caching
it for a period of time afterwards.
-Matej
On Dec 18, 2007 11:42 AM, kenixwong <[EMAIL PROTECTED]> wrote:
>
> okok.. more details here... i had summarize part of the code
>
> yes... i was loading a huge records for a report ( eg: 1 year records )
>
>
> Example
> ========
> The data that will display is based on the T&C as below
> 1. every minutes for one logID had 1 record. Means 1 days = 1440 records (
> 60 min * 24 hours)
> 2. eg here : i need to loop for 10 LogID for one year . Mean total records =
> 1440 records *10*365
> = 5256000 records (
> let said the fieldname is logID, userId,
> datetime, total_in)
>
>
> this 5256000 records will display using the dataView + dataProvider ==>
> fine, it is no problem
>
> beside, i will use JFreeChart to darw the TimeSeries Chart. ( avg vs min for
> each LOG) for the above 5256000 records
>
> When one pc run..fine, it is no problem. but once 3 pc run concurrently, the
> page return java.lang.OutOfMemoryError: Java heap space.
>
>
> code
> ===
> public ThisMonthNetworkChartForm(String id, LOG log ) {
>
>
> super(id);
>
> dataProvider = new SimpleReportDataProvider(log,
> periodCondition);
> dataView = new DataView("table", dataProvider)
> {
> protected void populateItem(final Item item)
> {
> final LOG log = (LOG)item.getModelObject();
>
> if(log.getDateTime()!= null){
> item.add(new
> Label("dateTime",String.valueOf(log.getDateTime())));
> item.add(new
> Label("logId",String.valueOf(log.getLogId())));
> item.add(new Label("total_in",
> String.valueOf(log.getTotal_in())));
>
> }else{
> item.add(new
> Label("dateTime",""));
> item.add(new Label("logId
> ",""));
> item.add(new Label("total_in
> ", ""));
> }
>
>
> item.add(new
> AttributeModifier("class", true, new
> AbstractReadOnlyModel()
> {
> public Object
> getObject(Component component)
> {
> return
> (item.getIndex() % 2 == 1) ? "row0" : "row1";
> }
> }));
>
>
>
> }//****populate item end here
> };
>
> dataView.setOutputMarkupId(true);
> add(dataView);
>
> final XYDataset dataset1 =
> LogManager.createTimeSeriesDataset(log,periodCondition);
> final JFreeChart chart =
> ChartFactory.createTimeSeriesChart(
> log.getLogID(),
> "Time",
> "Value",
> dataset1,
> true,
> true,
> false
> );
> JFreeChartImage images = (JFreeChartImage) new
> JFreeChartImage("image",chart , 900, 250);
> chart.setBackgroundPaint(new Color(237, 246,
> 253));//set the chart
> background to light blue
> add(images.setVisible(true));
>
> }
> }
>
>
>
> thanks in advance. :-D
>
>
>
>
>
> Matej Knopp-2 wrote:
> >
> > It's not possible to help you without knowing seeing more code. What
> > are the items you are creating? It's probably the models itself that
> > cause the outofmemory error, you are likely to be loading someting
> > huge.
> >
> > -Matej
> >
> > On Dec 17, 2007 6:12 AM, kenixwong <[EMAIL PROTECTED]> wrote:
> >>
> >> hi, anyone can help ?
> >>
> >> i was using the Eclipse 3.2.2, jdk1.6.0, jetty 6.0.2, wicket 1.2.4. Once
> >> i
> >> loop a report page, the eclipse console and page return the error as
> >> above.
> >> How can i solve it ....
> >>
> >> I had tryed to reset the eclispe.ini
> >> (http://bugs.sakaiproject.org/confluence/display/ARW/Eclipse+startup+memory+settings)
> >> too.
> >>
> >>
> >>
> >> here is the error
> >>
> >> ...
> >> ...
> >> ...
> >> at
> >> wicket.extensions.markup.html.repeater.refreshing.RefreshingView$1.newItem(RefreshingView.java:108)
> >> at
> >> wicket.extensions.markup.html.repeater.refreshing.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:73)
> >> at
> >> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.addItems(RefreshingView.java:191)
> >> at
> >> wicket.extensions.markup.html.repeater.refreshing.RefreshingView.internalOnAttach(RefreshingView.java:117)
> >> at wicket.Component.internalAttach(Component.java:2579)
> >> at
> >> wicket.MarkupContainer.internalAttach(MarkupContainer.java:341)
> >> at
> >> wicket.MarkupContainer.internalAttach(MarkupContainer.java:354)
> >> at
> >> wicket.MarkupContainer.internalAttach(MarkupContainer.java:354)
> >> at wicket.Page.renderPage(Page.java:383)
> >> at
> >> wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:160)
> >> at
> >> wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:60)
> >> at
> >> wicket.request.compound.DefaultResponseStrategy.respond(DefaultResponseStrategy.java:49)
> >> at
> >> wicket.request.compound.AbstractCompoundRequestCycleProcessor.respond(AbstractCompoundRequestCycleProcessor.java:66)
> >> at
> >> wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:902)
> >> at
> >> wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:929)
> >> at wicket.RequestCycle.step(RequestCycle.java:1010)
> >> at wicket.RequestCycle.steps(RequestCycle.java:1084)
> >> at wicket.RequestCycle.request(RequestCycle.java:454)
> >> at
> >> wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:219)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >> at
> >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
> >> at
> >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> >> at
> >> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
> >> at
> >> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
> >> at
> >> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
> >>
> >>
> >> Any solution ??
> >>
> >>
> >> thanks in advance..
> >> --
> >> View this message in context:
> >> http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tp14370078p14370078.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/java.lang.OutOfMemoryError%3A-Java-heap-space-tp14370078p14391978.html
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]