Re: 2.4 Official -- memory stuff

new topic     » goto parent     » topic index » view thread      » older message » newer message

Andy,

I believe this problem is insoluble in Eu 2.4 under Win 95/98/Me--the
problem is that heaps do not grow beyond their initial size and you can get
out of memory conditions when the heap is gone, even if you have plenty of
physical RAM--the OS can't allocate it. This issue does not occur in Win
NT/2000/XP --these can grow heaps beyond initial size.

I ran into the same problem in a VB 6.0 app on the job which dynamically
created a few hundred controls--always overflowed the heap on Win 98 ran
just fine on Win 2000.

By the way, per Microsoft the Win32 API has functions to dynamically grow
heaps, but they are not implemented in the 9x series (they are defined, but
they do not work), only in the NT series.

If upgrading to Win XP is not an option, I think you will have to do the
whole thing under 2.3 if there is no alternate way of accomplishing your
task--on the other hand, maybe there is a solution in Diamond that wouldn't
need so much saving and restoring. Bytecode is intended to implement
persistence--ordinarily, you would be saving to bytecode on disk before
shutdown and restoring from bytecode at startup--perhaps the program could
do its own memory management for holding the property values during the run.

Please correspond with me privately and I will attempt to help you get
something working under Eu 2.4.

-- Mike Nelson



----- Original Message -----
From: "Andy Serpa" <ac at onehorseshy.com>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, July 06, 2003 5:48 PM
Subject: RE: 2.4 Official -- memory stuff


>
>
> Robert Craig wrote:
> >
> >
> > Andy Serpa wrote:
> > > No tweak on the memory allocation?  I've got a growing list of
> > > "un-runnable" programs with 2.4.  Is this just a Windows ME problem?
> > > You said you had no trouble under XP?
> >
> > I had no trouble on my 256Mb RAM Windows XP system.
> > In fact, your program ran quite fast.
> >
> > I couldn't see any easy tweak to help you out on ME.
> > It was also very slow on my 64Mb ME system
> > (even after scaling things down).
> > Some things you can do:
> >
> >     - reduce the size of the sequences
> >     - make more use of integers rather than floating-point
> >     - create sequences at their final size, rather than
> >       "growing them" with append or concatenation
> >
> > In general, 2.4 is faster at allocating memory than 2.3.
> > However your program really mangles the system heap.
> > On Windows, 2.3 uses Watcom's heap manager, but
> > to make Euphoria .dll's work reliably I must use the
> > system heap, so that's what 2.4 does. The system heap
> > might be using an extra 4 bytes per floating-point number.
> > I'm not sure.
> >
>
> This has become a more general problem than I thought at first.  I had
> to break up one of my programs so the "heavy-lifting" is done with a
> 2.3-translated program instead of 2.4 (other parts make use of the 2.4
> features which I don't want to give up -- like user-defined types being
> called w/ translator).
>
> For instance, here's a problem:  I'm using Diamond, and the 2.3 part of
> the program creates a bunch about 150 Diamond entities. (This program
> takes 10x longer to run in 2.4 -- that's after rewriting the whole
> algorithm.  Before it would never finish at all.) Each entity has one
> property which will hold a somewhat large sequence (each entity takes
> about 1/3 MB on disk after converting to byte code).  The goal would be
> to hold all these entities in RAM at the same time.  I've got plenty
> enough RAM to do that.  Problem is, even if I create the entities in
> 2.3, I can't even load them in 2.4 (without it taking forever and a
> day)!  That's because they're stored on disk as bytecode and after the
> bytecode for an entity is read from disk, the entity needs to be
> restored with the Diamond function restore_entity().  Apparently this
> transformation is enough to "mangle the heap" (unless there really is
> just an outright bug somewhere in 2.4) and if I try to load in the rest
> of the entities each one takes longer & longer.  So now if I want to
> have access to all the entities I have to do something like store the
> bytecode for each one in an EDS database or something and never have
> more than one (or a few, anyway) "restored" at a time.  As I said
> before, there seems to be a definite threshold for this -- if I load in
> one entity everything is fine.  And if I destroy that entity before
> loading in the next one everything is fine.  But if I load in 10 or so
> then that's all she wrote.  So now I'm in the position where I would
> have to restore each entity *EACH* time I want to use it, which of
> course causes a different kind of slowdown -- what I really want is
> access to all of them at once.  There is basically no way around it --
> such a program just doesn't work in 2.4 (on this platform) in any
> practical sense if I can't even get the objects in memory.
>
> Bottom line: it seems that with ME/98/95, any program which uses more
> than a little memory in any sort of flexible way is doomed.  Since one
> of the main features of Euphoria is supposed to be flexible use of data,
> garbage collection, etc., the price seems rather high.  I am effectively
> limited to programs which use no more than a few MBs of RAM on a machine
> which has 512 MB available!  I can't be the only one who is going to
> have a problem with this...
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu