wanjidong / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

out of memory was caused by mass objects #205

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. fetch back about 20000 lines' record from db as a list
2. set to jmesa 
3. after 2mins , an Exception -- out of memory showed on page 

What is the expected output? What do you see instead?
my page limit is 10000, so i expected a 10000 lines' list finally to be 
rendered on the page.

What version of the product are you using? On what operating system?
the lastest one.

Please provide any additional information below.
when the limit was 5000, the rendering process was still too slow to wait.
any suggestion ?

Original issue reported on code.google.com by magicbil...@gmail.com on 11 Jul 2009 at 2:29

GoogleCodeExporter commented 8 years ago
You will want to use the Limit to efficiently just pull one page of data at a 
time.

http://code.google.com/p/jmesa/wiki/LimitTutorial

Original comment by jeff.johnston.mn@gmail.com on 11 Jul 2009 at 11:44

GoogleCodeExporter commented 8 years ago

Original comment by jeff.johnston.mn@gmail.com on 14 Jul 2009 at 3:07

GoogleCodeExporter commented 8 years ago
hi, Jeff 
I know what does the Limit for. 
but the project , I am handling with, gets some bizarre requirement, 
and no-pagination is one of them.
so here efficiency issue goes again. 
actually , I am using limit mode all the time, and trying to find a suitable 
page size 
for the project.
but when the page size gets over 500, the rendering speed drops sharply.
and a page like that big is just a normal page in the system.
my point is , is there any trick to improve rendering efficiency ?

Original comment by magicbil...@gmail.com on 14 Jul 2009 at 4:02

GoogleCodeExporter commented 8 years ago
Ok, I see what you are doing now. However, I assume the speed issue is not 
caused by
JMesa? I assume the created html is pretty fast but the rendering is slow? You 
could
test that out by doing a view->source on that page and copy and paste the JMesa
output directly in your page. That way you would know if it is JMesa that is 
slow, or
the browser rendering.

Also let me know if you are using the tag library or the API directly. It could 
be
the JSP tag having a hard time loading so much.

Original comment by jeff.johnston.mn@gmail.com on 14 Jul 2009 at 8:04

GoogleCodeExporter commented 8 years ago
That is absolutky right! the slow part is jsp rendering.
Getting limit object loaded is sth out of jmesa control, which is completed by 
my
query engine. so fulling limit is not an issue.
----------------------------
my problem is that I put jmesa's jsp tag into operation too ambitiously, 
actually
most query needs in my project are quite easy , so I could design a rendering
template jsp with jmesa tag to handle each of them without rewrite a bit of 
html code :) 
u may take a look at the template code at below.
so far my only solution of this issue is to chop down limit's page size, 
but I still will do some test to discover the jsp template's downside.

<jmesa:struts2TableFacade id="${viewId}" items='${viewInfo.listData}'
                stateAttr="restore" var="bean" limit="${viewInfo.extraInfo.limit}"
                toolbar="aicu.application.mps.voice.widget.jmesa.FullPaginationToolbar">
                <jmesa:htmlTable caption="${captionName}"
                    width="100%">
                    <jmesa:htmlRow filterable="false">

                        <s:if test="#attr.__sitemesh__page.properties.radiobox!=null">
                            <jmesa:htmlColumn
                                property="${attr.__sitemesh__page.properties.radiobox}1"
                                title="单选" width="30px" style="">
                                <input type="radio" name="${viewId}rid"
                                    value='${bean[attr.__sitemesh__page.properties.radiobox]}' />
                            </jmesa:htmlColumn>
                        </s:if>

                        <s:if test="#attr.__sitemesh__page.properties.checkbox!=null">
                            <jmesa:htmlColumn
                                property="${attr.__sitemesh__page.properties.checkbox}1"
                                title="多选" width="30px">
                                <input type="checkbox" name="${viewId}cid"
                                    value='${bean[attr.__sitemesh__page.properties.checkbox]}' />
                            </jmesa:htmlColumn>
                        </s:if>

                        <c:forEach var="col" items="${viewInfo.viewMetadata.columns}">

                            <s:if test="viewInfo.viewMetadata.i18n == true">
                                <s:set var="columnName" value="getText(#attr.col.name)"/>               
                            </s:if>
                            <s:else>
                                <s:set var="columnName" value="#attr.col.name"/>                            
                            </s:else>

                            <c:choose>                          
                                <c:when test="${col.convert!='' && col.convert!=null}">                             
                                    <jmesa:htmlColumn property="${col.code}"
                                        pattern="${col.format}" title='${columnName}'>                          

                                            <s:if
test="#attr.menuMaps.messages[#attr.col.convert][#attr.bean[#attr.col.code]]!=nu
ll">
                                                <s:property
value="#attr.menuMaps.messages[#attr.col.convert][#attr.bean[#attr.col.code]]" 
/>
                                            </s:if>
                                            <s:else>
                                                ${col.convertDefValue}
                                            </s:else>
                                    </jmesa:htmlColumn>
                                </c:when>
                                <c:otherwise>
                                    <jmesa:htmlColumn property="${col.code}" title='${columnName}'>
                                        <c:choose>
                                            <c:when test="${col.format=='date'}">
                                                <fmt:formatDate value="${bean[col.code]}" type="both"
                                                    pattern="yyyy-MM-dd" />
                                            </c:when>
                                            <c:when test="${col.format=='datetime'}">
                                                <fmt:formatDate value="${bean[col.code]}" type="both"
                                                    pattern="yyyy-MM-dd hh:mm:ss" />
                                            </c:when>
                                            <c:when test="${col.format=='cnmoney'}">
                                                <fmt:formatNumber value="${bean[col.code]}" type="number"
                                                    pattern="¥#,#00.00" />
                                            </c:when>
                                            <c:when test="${col.format=='usmoney'}">
                                                <fmt:formatNumber value="${bean[col.code]}" type="number"
                                                    pattern="$#,#00.00" />
                                            </c:when>
                                            <c:when test="${col.format=='plain'}">
                                            ${bean[col.code]}
                                    </c:when>
                                        </c:choose>
                                    </jmesa:htmlColumn>
                                </c:otherwise>
                            </c:choose>
                        </c:forEach>

                    </jmesa:htmlRow>

                </jmesa:htmlTable>
            </jmesa:struts2TableFacade>

Original comment by magicbil...@gmail.com on 15 Jul 2009 at 1:30

GoogleCodeExporter commented 8 years ago

Original comment by jeff.johnston.mn@gmail.com on 17 Jul 2009 at 2:45