On Fri, 5 Nov 1999, Anthony Gardner wrote:
> All,
>
> I have a problem.
>
> I want to use data in XML format and store it in memory for obvious reasons
> of speed and to utilise the capabilities of XML. I also want to load the
> data at server start up time.
>
> The problem arises with the size of the data. I end up with six children
> each with 150MB of data. Needless to say I've run out of memory and the
> error_log gives error msgs about not being able to fork.
Is this a read only data? If it's is you are doing something wrong of you
end up with each child having a separate copy. What you should do is:
MyData.pm:
package MyData;
%MyData::data = read_data();
then in startup.pl:
use MyData;
then in your scripts:
use MyData;
print $MaData{key};
If it's a read/write data, you must use a DB or use another approach, like
Shared memory, Apache::MM or alike.
Please tell the list how did you solve the problem, when you do so. This
is quite important, at least I want it documented in the guide. Thanks
>
> I really would like to keep the data in XML format and not use a DB. How can
> I make it so that the children reference one copy of data and not have their
> own.
>
> I've tried assigning the $doc from $xp->parsefile to IPC::Shareable but that
> keels over under the load.
>
> I could maybe get away with not loading the data at startup time but how can
> the children reference it?
>
> Have I over looked a simple strategy? Or Wot!!
>
>
> Thanks in advance
>
>
> -Ants.
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
_______________________________________________________________________
Stas Bekman mailto:[EMAIL PROTECTED] www.singlesheaven.com/stas
Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC
www.apache.org & www.perl.com == www.modperl.com || perl.apache.org
single o-> + single o-+ = singlesheaven http://www.singlesheaven.com