Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Rebol for real world applications

From: sf::sabufrancis::com at: 19-Nov-2003 15:08

Hi: I have been developing a real world mailing list CGI application (i.e. not the "Hello World" kind :-) ) layer by layer, testing each part for correctness. It had been going quite well till I realized that my program is running out of memory when it is given real world data :-) and now even the rebol interpreter is crashing (The Encapped version crashes even with lesser data for some reason) I removed unwanted network protocols from my encapped application, and that improved the situation slightly. But when I feed large emails to my mailing list app, it crashes. I see two reasons for this to happen. One is that I am reading a fairly large configuration file where parameters for the mailing list are set (Things like subscription welcome email, moderation email... stuff that the mailing list system will send out to subscribers) That file is a human readable Rebol code file. In order that the users of my mailing list app does not put some Rebol code inside that configuration file and screw up my license with Rebol, I use the following func which converts the file into an object as shown below: ;;;;Warning: UNTESTED CODE cfg: make object! [] ; global variable. Is this needed? pp: [] ; global variable. Is this needed? loadCfg: function [cfgfile] [kk] [ either error? try [ kk: read cfgfile pp: to-block kk ] [ return false ] [ cfg: make object! pp clear pp; return true ] ] Once the configuration file becomes an object, then I pick up the configuration parameter I want by using the appropriate path into that object. The second part of the reason for these crashes could be that each email is opened up, footers are inserted into the email and then given over to another function to be sent to the mailing list subscribers. All that must be taking up memory. The question here is: How does memory management work in Rebol? Are global variables better than local ones? I would appreciate any help. The thing is driving me nuts :-) (As you can see, there are too many smileys already in my post) Regards Sabu Francis