| filsa.net: Frontier Scripting [ Script Archive | Ideas & Issues | Polyglot | Software | Projects ] |
|
|
Render Table Memory IssuesAn easy fix to a problem with rendering huge websitesI recently spoke with a friend who has a huge website in Frontier. It is over 150 megabytes, with a large number of images. I have no idea how many pages it actually is.Memory leak? Anyway, this friend complained of a memory leak when rendering a table. He had actually asked Userland about this and been told it was not a memory leak. I didn't think it was a memory leak either--but whether it was a leak or not, he was still getting out of memory errors whenever he tried to render his whole site. So, the issue was still unresolved. What was goin' on As Frontier renders a website, it loads objects into memory from disk. These objects stay in memory until the database gets saved, when they are flushed out (or if modified, written out to disk). What was happening of course, is that Frontier loaded more and more of my friend's huge site into memory, it eventually ran out. An easy fix The fix for this is easy. I put this fix into html.commands.releaseTable, although there may be a better place for it. Looking inside the publishTable () routine for the doTable () routine. Inside the for i = 1 to ct loop, after the window.msg verb, I inserted a couple lines:
if memAvail () < 1024 * 1000 /\/ less than 1000k \{
filemenu.save (); }
That did the trick. Not a leak Anyway, it wasn't a leak, but it was a problem. It was a dealstopper for him, which is just as bad as a memory leak. I'd ask Userland to consider making a similar change somewhere in the rendering code. It'll prevent unnecessary complaints of memory leaks that aren't really there. This code should also be added to the batchexport.import script to avoid the same problem. Thanks for listening. Phil |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is Phil's Frontier Scripting Site. San Francisco, CA |
| filsa.net: Frontier Scripting [ Script Archive | Ideas & Issues | Polyglot | Software | Projects ] |