The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

HP48 garbage collection
Message #1 Posted by Chan Tran on 4 Oct 2004, 3:39 p.m.

My 48GX and also the SX, but I haven't used the SX for quite sometime so I don't remember, tends to freeze for a couple of seconds after I key in a few entries. I think this is due to garbage collection but how to I reduce the frequency of this action as it really slow me down. It's a shame as these calculators are significantly faster than the 41's that I have.

      
Re: HP48 garbage collection
Message #2 Posted by Raymond Del Tondo on 4 Oct 2004, 3:57 p.m.,
in response to message #1 by Chan Tran

Hi,

I think the answer is in the FAQ at www.hpcalc.org ;-)

Raymond

            
Re: HP48 garbage collection
Message #3 Posted by Rick on 4 Oct 2004, 5:54 p.m.,
in response to message #2 by Raymond Del Tondo

Hi, Please show me where, because my calculator does the same thing. It is quite irritating sometimes.

                  
Re: HP48 garbage collection
Message #4 Posted by Raymond Del Tondo on 5 Oct 2004, 8:14 a.m.,
in response to message #3 by Rick

Hi,

be assured this is normal for RPL machines.
The delay effect has many parameters, like stack depth,
free RAM, etc...
Usually it helps much to have not too many objects on the data stack.

Please take a look there:

http://www.hpcalc.org/hp48/docs/faq/

and maybe there

http://www.hpcalc.org/search.php?query=Garbage+Collection&hp48=1

Raymond

                        
Re: HP48 garbage collection
Message #5 Posted by Francesc Casanellas on 5 Oct 2004, 10:35 a.m.,
in response to message #4 by Raymond Del Tondo

I do not agree that this is normal in a well engineered RPN machine.

I have had nearly all HP RPN calculators from the beginning: I do not remember HP25C, 29C, 67C, 41, etc. to have the pausing problem.

In my HP48G the problem was still passed unnoticed.

When I bought an HP49G I returned it (HP accepted the return) because the garbage collector problem was so bad that it made the machine unusable for any serious continous work.

Later on, the ROM version 1.19-6 appeared (not supported by HP), where the pausing appears only from time to time. I have a new HP49G (one of the latest to be manufactured) with this software version and although the problem is not absolutely fixed, is bearable.

So pausing owing to garbage collector depends NOT on being a RPN machine but on how the software is made. HP is giving examples of how thinks can be worsened: i.e. in some aspects new HP49G+ were worse than HP49: even worse keyboard, battery problems, etc., and HP49G had some features worse than HP48 (of course there have been improvements in speed and other features).

Edited: 5 Oct 2004, 4:53 p.m. after one or more responses were posted

                              
Re: HP48 garbage collection
Message #6 Posted by Ron Ross on 5 Oct 2004, 10:57 a.m.,
in response to message #5 by Francesc Casanellas

Actually the lower end 32K RAM 48G didn't really suffer from this problem to a noticiable extent, because of its small amount of RAM. Kinda makes the plain 48G somewhat better for general number crunching. I too, did not really mind when I had only a low end 48G, but quickly found out about the long delay when I acquired a 48GX and added RAM cards.

And my 49G did act worse until I upgraded the ROM. Of course the newest 49G+ is so fast that even if there is garbage collection, I haven't noticed.

                                    
Re: HP48 garbage collection
Message #7 Posted by Chan Tran on 5 Oct 2004, 12:08 p.m.,
in response to message #6 by Ron Ross

May be that is what it is. My 48SX has only 32K of RAM the GX has 256K (with the added 128K RAM card) and it is quite bad in this respect.

                              
Re: HP48 garbage collection
Message #8 Posted by James M. Prange on 6 Oct 2004, 2:49 a.m.,
in response to message #5 by Francesc Casanellas

Raymond mentioned RPL, not RPN. RPL does use Reverse Polish Notation, but it's not the same programming language used on earlier HP RPN models, and "Garbage Collection" is very much part of RPL. Actually, it may better be considered "Memory Packing"; it's a matter of moving still referenced objects in temporary memory to occupy contiguous memory, overwriting unreferenced objects. Garbage collection is done whenever the amount of free memory gets too low.

In general, having more free memory means that garbage collection won't need to be done so often, but when it is done, it takes longer. This explains why it's less noticeable on a 48S/G (or 48SX/GX without any merged memory).

Of course, fewer objects (actually, pointers to objects) on the stack will generally result in a faster garbage collection too. Avoid filling up the stack with objects that you no longer need.

John H Meyers wrote some posts on reducing free memory so that the garbage collections were fast enough to be less of an annoyance to some. Personally, I prefer less frequent garbage collections, even though they do take longer. See this search for some of John's posts on this matter. He might have something about it on http://www.hpcalc.org/ too.

Garbage collection can be drastically slowed when the stack contains many pointers into composite objects. Typically, the composite will be a list type object. See my post for some demonstration programs on this effect. Note that if you know that a program could suffer from this, then you might be able to avoid it by forcing a garbage collection ahead of time.

Regards,
James

                                    
Re: HP48 garbage collection
Message #9 Posted by James M. Prange on 6 Oct 2004, 5:47 a.m.,
in response to message #8 by James M. Prange

PS:

My demonstration programs use the TEVAL command, which is available only in the 49 series. See http://www.hpcalc.org/details.php?id=6112 for a UserRPL timer program which will also work on the other RPL models. I expect that it's more accurate than TEVAL too, plus it works regardless of the wordsize.

Also, one of the programs uses UNPICK, which is another 49 series only command. For that one, I suppose that using ROLL in place of PICK and ROLLD in place of UNPICK ought to work, athough they'll be slower.

Also note that the results from the BYTES command are for the 49g+; expect them to be different on the 48 series.

Regards,
James

Edited: 6 Oct 2004, 5:52 a.m.

      
Re: HP48 garbage collection
Message #10 Posted by James M. Prange on 6 Oct 2004, 3:41 a.m.,
in response to message #1 by Chan Tran

Note that the RPL calculators have some "type-ahead" capability. Up to 15 keystrokes can be stored in a First-In First-Out buffer while the "busy" annunciator is on, and this buffer is checked for unprocessed keystrokes when the calculator finishes with whatever it's doing.

For example, I can execute 30 WAIT, and then type in "HELLO WORLD" [ENTER] (14 keystrokes, with flag -60 set) during the wait time, to have the string appear on the stack after the 30 seconds are up. On the 48 and 49 series, after 15 keystrokes are in the buffer, pressing a key results in a "warble" type sound; the 28 series silently ignores additional keystrokes.

But it can be a bit disconcerting to press a key and not see (or hear) anything immediately happen because the calculator is busy doing something else, such as a garbage collection.

Regards,
James

Edited: 6 Oct 2004, 4:04 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall