<div dir="ltr">Hi Saulo,<div><br></div><div>Exactly right about the heap. I'd be very surprised if the page blankness is because of heap-related issues.</div><div><br></div><div>Nested [mapX]s are definitely okay. Maybe it's just that all of the [taskRows] lists are empty for some reason? (I haven't carefully read your queries.) Because all your xml is generated in that innermost loop, if that was the case, every innermost [mapX] would map over 0 things and you'd get no output. Perhaps try something like:</div><div><br></div><div><div style="font-size:13px">fun main () =</div><div style="font-size:13px"> timeSheet <- timeSheet 1;</div></div><div><div style="font-size:13px"> return</div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span><xml></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> <body></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> <table></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> {case timeSheet of</div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> TimeSheet (projectRows) =></div><div style="font-size:13px"> <span style="white-space:pre-wrap"> </span> mapX (fn projectRow =></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> case projectRow of</div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span>ProjectRow (projectId, projectName, taskRows) =></div><div style="font-size:13px">(**** begin new stuff ****)</div><div style="font-size:13px"><span style="white-space:pre-wrap"> <xml></span><br></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span><tr></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span><span style="white-space:pre-wrap"> </span><th>{[projectId]}</th></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span><span style="white-space:pre-wrap"> </span><th>{[projectName]}</th></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span></tr></div><div style="font-size:13px"><span style="white-space:pre-wrap"> {</span><br></div><span style="font-size:13px">(**** end new stuff ****)</span><div style="font-size:13px"><span style="white-space:pre-wrap"> </span>mapX (fn taskRow =></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> case taskRow of</div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> TaskRow (taskId, taskName, _) =></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> <xml></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> <tr></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> <td>{[projectId]}</td></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> <td>{[projectName]}</td></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> <td>{[taskId]}</td></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> <td>{[taskName]}</td><span style="white-space:pre-wrap"> </span> </div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> </tr></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> </xml>)</div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> taskRows)</div><div style="font-size:13px">(**** begin new stuff ****)<br></div><div style="font-size:13px"><span style="white-space:pre-wrap"> }</span><br></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </xml></span><span style="white-space:pre-wrap"><br></span></div><span style="font-size:13px">(**** end new stuff ****)</span><div style="font-size:13px"><span style="white-space:pre-wrap"> </span>projectRows}</div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> </table></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span> </body></div><div style="font-size:13px"><span style="white-space:pre-wrap"> </span></xml></div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 8, 2016 at 11:13 AM, Saulo Araujo <span dir="ltr"><<a href="mailto:saulo2@gmail.com" target="_blank">saulo2@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I just found out that the messages "<span style="font-size:12.8px">Error triggers unlimited retry: Couldn't allocate new heap chunk contiguously; increasing size to..." are not error messages, but informative ones. Also, the Ur/Web manual talks about the minHeap setting. After setting it to 1024 in my project file, the messages vanished, as expected. Unfortunately, my page is blank. If I remove the inner mapX like below, I can see the projects stored in the database. Does anyone know what I am doing wrong? Is it possible to nest mapX like I did?</span><div><span style="font-size:12.8px"><br></span></div><div><span class=""><div style="font-size:12.8px"> {case timeSheet of</div><div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span> TimeSheet (projectRows) =></div><div style="font-size:12.8px"> <span style="white-space:pre-wrap"> </span> mapX (fn projectRow =></div><div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span> case projectRow of</div><div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span>ProjectRow (projectId, projectName, taskRows) =></div></span><span class=""><div style="font-size:12.8px"><span style="font-size:12.8px;white-space:pre-wrap"> </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px"> <xml></span><br></div><div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span> <tr></div><div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span> <td>{[projectId]}</td></div></span><div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span> <td>{[projectName]}</td> <span style="font-size:12.8px">(* ... *)</span></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Sincerely,</div><div style="font-size:12.8px">Saulo</div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 8, 2016 at 11:38 AM, Saulo Araujo <span dir="ltr"><<a href="mailto:saulo2@gmail.com" target="_blank">saulo2@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am getting the error</div><div><br></div><div>"Error triggers unlimited retry: Couldn't allocate new heap chunk contiguously; increasing size to 512"</div><div><br></div><div>when I execute the following program</div><div><br></div><div><div>open List</div><div><br></div><div>table user_table: {ID: int, NAME: string} PRIMARY KEY ID</div><div><br></div><div>table project_table: {ID: int, NAME: string, DESCRIPTION: string, USER_ID: int} PRIMARY KEY ID,</div><div> CONSTRAINT USER_ID FOREIGN KEY USER_ID REFERENCES user_table(ID)</div><div><br></div><div>table task_table: {ID: int, NAME: string, DESCRIPTION: string, USER_ID: int} PRIMARY KEY ID,</div><div> CONSTRAINT USER_ID FOREIGN KEY USER_ID REFERENCES user_table(ID)</div><div><br></div><div>table project_task_table: {PROJECT_ID: int, TASK_ID: int} PRIMARY KEY (PROJECT_ID, TASK_ID),</div><div> CONSTRAINT PROJECT_ID FOREIGN KEY PROJECT_ID REFERENCES project_table (ID),</div><div> CONSTRAINT TASK_ID FOREIGN KEY TASK_ID REFERENCES task_table (ID)</div><div><br></div><div>table entry_table: {PROJECT_ID: int, TASK_ID: int, DATE: time, TIME: int} PRIMARY KEY (PROJECT_ID, TASK_ID, DATE)</div><div> CONSTRAINT PROJECT_ID FOREIGN KEY PROJECT_ID REFERENCES project_table (ID),</div><div> CONSTRAINT TASK_ID FOREIGN KEY TASK_ID REFERENCES task_table (ID)</div><div><br></div><div>datatype entry_cell = EntryCell of int * float</div><div><br></div><div>datatype task_row = TaskRow of int * string * list entry_cell</div><div><br></div><div>datatype project_row = ProjectRow of int * string * list task_row</div><div><br></div><div>datatype time_sheet = TimeSheet of list project_row</div><div><br></div><div>fun timeSheet userId =</div><div> projectIdTaskRowsPairs <- query (SELECT <a href="http://P.ID" target="_blank">P.ID</a> AS PROJECT_ID, <a href="http://T.ID" target="_blank">T.ID</a> AS ID, <a href="http://T.NAME" target="_blank">T.NAME</a> AS NAME</div><div><span style="white-space:pre-wrap"> </span> FROM project_table AS P</div><div><span style="white-space:pre-wrap"> </span> INNER JOIN project_task_table AS PT ON PT.PROJECT_ID = <a href="http://P.ID" target="_blank">P.ID</a></div><div><span style="white-space:pre-wrap"> </span> INNER JOIN task_table AS T ON <a href="http://T.ID" target="_blank">T.ID</a> = PT.TASK_ID</div><div><span style="white-space:pre-wrap"> </span> WHERE P.USER_ID = {[userId]}</div><div><span style="white-space:pre-wrap"> </span> ORDER BY <a href="http://T.NAME" target="_blank">T.NAME</a>)</div><div><span style="white-space:pre-wrap"> </span> (fn r projectIdTaskRowsPairs =></div><div><span style="white-space:pre-wrap"> </span>let val projectIdTaskRowsPair = (r.PROJECT_ID, TaskRow (r.ID, r.NAME, [])) in</div><div><span style="white-space:pre-wrap"> </span> return (projectIdTaskRowsPair :: projectIdTaskRowsPairs)</div><div><span style="white-space:pre-wrap"> </span>end)</div><div><span style="white-space:pre-wrap"> </span> [];</div><div><br></div><div> projectRows <- query (SELECT <a href="http://P.ID" target="_blank">P.ID</a> AS ID, <a href="http://P.NAME" target="_blank">P.NAME</a> AS NAME</div><div><span style="white-space:pre-wrap"> </span> FROM project_table AS P</div><div><span style="white-space:pre-wrap"> </span> WHERE P.USER_ID = {[userId]}</div><div><span style="white-space:pre-wrap"> </span> ORDER BY <a href="http://P.NAME" target="_blank">P.NAME</a>)</div><div><span style="white-space:pre-wrap"> </span> (fn r projectRows =></div><div><span style="white-space:pre-wrap"> </span> let val projectIdTaskRowsPairs = filter (fn (projectId, _) => projectId = r.ID) projectIdTaskRowsPairs</div><div><span style="white-space:pre-wrap"> </span> val taskRows = mp (fn (_, taskRow) => taskRow) projectIdTaskRowsPairs</div><div><span style="white-space:pre-wrap"> </span> val projectRow = ProjectRow (r.ID, r.NAME, taskRows)</div><div><span style="white-space:pre-wrap"> </span> in</div><div><span style="white-space:pre-wrap"> </span> return (projectRow :: projectRows)</div><div><span style="white-space:pre-wrap"> </span> end)</div><div><span style="white-space:pre-wrap"> </span> [];</div><div><br></div><div> return (TimeSheet projectRows)</div><div> </div><div>fun main () =</div><div> timeSheet <- timeSheet 1;</div><div><br></div><div> return</div><div><span style="white-space:pre-wrap"> </span><xml></div><div><span style="white-space:pre-wrap"> </span> <body></div><div><span style="white-space:pre-wrap"> </span> <table></div><div><span style="white-space:pre-wrap"> </span> {case timeSheet of</div><div><span style="white-space:pre-wrap"> </span> TimeSheet (projectRows) =></div><div> <span style="white-space:pre-wrap"> </span> mapX (fn projectRow =></div><div><span style="white-space:pre-wrap"> </span> case projectRow of</div><div><span style="white-space:pre-wrap"> </span>ProjectRow (projectId, projectName, taskRows) =></div><div><span style="white-space:pre-wrap"> </span>mapX (fn taskRow =></div><div><span style="white-space:pre-wrap"> </span> case taskRow of</div><div><span style="white-space:pre-wrap"> </span> TaskRow (taskId, taskName, _) =></div><div><span style="white-space:pre-wrap"> </span> <xml></div><div><span style="white-space:pre-wrap"> </span> <tr></div><div><span style="white-space:pre-wrap"> </span> <td>{[projectId]}</td></div><div><span style="white-space:pre-wrap"> </span> <td>{[projectName]}</td></div><div><span style="white-space:pre-wrap"> </span> <td>{[taskId]}</td></div><div><span style="white-space:pre-wrap"> </span> <td>{[taskName]}</td><span style="white-space:pre-wrap"> </span> </div><div><span style="white-space:pre-wrap"> </span> </tr></div><div><span style="white-space:pre-wrap"> </span> </xml>)</div><div><span style="white-space:pre-wrap"> </span> taskRows)</div><div><span style="white-space:pre-wrap"> </span>projectRows}</div><div><span style="white-space:pre-wrap"> </span> </table></div><div><span style="white-space:pre-wrap"> </span> </body></div><div><span style="white-space:pre-wrap"> </span></xml></div></div><div><br></div><div>Does anyone knows how to circumvent it? Is it possible to configure the size of the heap?</div><div><br></div><div>Sincerely,</div><div>Saulo</div><div><br></div></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Ur mailing list<br>
<a href="mailto:Ur@impredicative.com">Ur@impredicative.com</a><br>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" rel="noreferrer" target="_blank">http://www.impredicative.com/cgi-bin/mailman/listinfo/ur</a><br>
<br></blockquote></div><br></div>