comp.lang.ada
 help / color / mirror / Atom feed
* Re: Memory leak in porting VAX/VMS -> AXP/VMS
  1996-04-09  0:00 Memory leak in porting VAX/VMS -> AXP/VMS Mats Weber
@ 1996-04-09  0:00 ` Chet
  1996-04-10  0:00 ` Rick Gillmore
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Chet @ 1996-04-09  0:00 UTC (permalink / raw)
  To: Mats.Weber

We will be undergoing a major port of VAX/VMS Ada to AXP/VMS Ada in the next
year. I will keep you posted on this news group if I find any problems.

I have a question for all of you ? Do you know if DEC supplies above and 
beyond the UCX$INETDEF.ADA for the internet socket bindings. I mean this
is great, they defined most if not all structures needed for pragmatized
C-socket lib's. But I'm lazy and want the full package. If anybody knows
where to get this let me know. Thanks in advance.

                             Chet
                             kackman@GDEsystems.com





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Memory leak in porting VAX/VMS -> AXP/VMS
@ 1996-04-09  0:00 Mats Weber
  1996-04-09  0:00 ` Chet
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mats Weber @ 1996-04-09  0:00 UTC (permalink / raw)


Hi,

We have ran into a problem while porting a VAX Ada program from VAX/VMS to
AXP (Alpha)/VMS using DEC's compiler.

The program works fine on VAXes, but leaks lots of memory on the AXP. Has
anyone else had the same problem ? Does anyone know of tools to locate
such leaks on an AXP/VMS machine (DEC's heap analyser is for VAX/VMS only)
?

Thanks for any answers




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Memory leak in porting VAX/VMS -> AXP/VMS
  1996-04-09  0:00 Memory leak in porting VAX/VMS -> AXP/VMS Mats Weber
  1996-04-09  0:00 ` Chet
@ 1996-04-10  0:00 ` Rick Gillmore
  1996-04-11  0:00 ` Larry Kilgallen
  1996-04-11  0:00 ` Mats Weber
  3 siblings, 0 replies; 5+ messages in thread
From: Rick Gillmore @ 1996-04-10  0:00 UTC (permalink / raw)


Mats.Weber@elca-matrix.ch (Mats Weber) wrote:
>Hi,
>
>We ran into a problem while porting a VAX Ada program from VAX/VMS to
>AXP (Alpha)/VMS using DEC's compiler.
>
>The program works fine on VAXes, but leaks lots of memory on the AXP. >Has anyone else had the same problem ? Does anyone know of t=
ools to >locate such leaks on an AXP/VMS machine (DEC's heap analyser is for >VAX/VMS only)?

We reported a problem with ADA V3.2 on the AXP which involved creating a 
string within a procedure call, and losing memory across the call.  This 
problem has been fixed in ADA V3.3.  If you are not running V3.3 on your 
AXP, I would suggest you upgrade.  The following program demonstrates the 
problem we had:

WITH Text_IO; USE Text_IO;
PROCEDURE Leak IS
   last_bytes, bytes : INTEGER;
   PROCEDURE Check (text : STRING) IS BEGIN NULL; END Check;
   PROCEDURE Get_Vm_Stats (code : IN INTEGER; value : OUT INTEGER);
   PRAGMA Interface (Ada, Get_Vm_Stats);
   PRAGMA Import_Procedure (Get_Vm_Stats, "Lib$Stat_Vm",
          (INTEGER, INTEGER), (REFERENCE, REFERENCE));
BEGIN
   Get_Vm_Stats (3, last_bytes);
   FOR size IN 0 .. 1000 LOOP
      Check ("Bad line " & Integer'Image(size));
   END LOOP;
   Get_Vm_Stats (3, bytes);
   Put_Line ("Lost" & Integer'Image(bytes-last_bytes) & " bytes.");
END Leak;

I don't know if this is your problem or not, but you may want to look for 
any such calls...

Good luck.

Rick Gillmore
GE Drive Systems





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Memory leak in porting VAX/VMS -> AXP/VMS
  1996-04-09  0:00 Memory leak in porting VAX/VMS -> AXP/VMS Mats Weber
                   ` (2 preceding siblings ...)
  1996-04-11  0:00 ` Larry Kilgallen
@ 1996-04-11  0:00 ` Mats Weber
  3 siblings, 0 replies; 5+ messages in thread
From: Mats Weber @ 1996-04-11  0:00 UTC (permalink / raw)


We just found the memory leak. It was in a function that converts a binary
tree into an array, something like:

      function Equiv (L : Link) return List is
      begin
         if L = null then
            declare

               Null_List : List(1..0);

            begin
               return Null_List;
            end;
         else
            if Key_Of(Item) < Key_Of(L.Val) then
               return Equiv(L.Left);
            elsif Key_Of(Item) = Key_Of(L.Val) then
               if Equal(Item, L.Val) then
                  return Equiv(L.Left) & L.Val & Equiv(L.Right);
               else
                  return Equiv(L.Left) & Equiv(L.Right);
               end if;
            else
               return Equiv(L.Right);
            end if;
         end if;
      end Equiv;

which was in a generic that was instantiated with a type with
discriminants. I changed the code to remove the combination of "&" and
recursion and now it doesn't leak memory anymore. I haven't yet tried
version 3.3 of the VMS/AXP compiler to see if the bug has gone.

Thanks to all those who answered.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Memory leak in porting VAX/VMS -> AXP/VMS
  1996-04-09  0:00 Memory leak in porting VAX/VMS -> AXP/VMS Mats Weber
  1996-04-09  0:00 ` Chet
  1996-04-10  0:00 ` Rick Gillmore
@ 1996-04-11  0:00 ` Larry Kilgallen
  1996-04-11  0:00 ` Mats Weber
  3 siblings, 0 replies; 5+ messages in thread
From: Larry Kilgallen @ 1996-04-11  0:00 UTC (permalink / raw)


In article <Mats.Weber-0904962310310001@mlma21.elca-matrix.ch>, Mats.Weber@elca-matrix.ch (Mats Weber) writes:

> The program works fine on VAXes, but leaks lots of memory on the AXP. Has
> anyone else had the same problem ? Does anyone know of tools to locate
> such leaks on an AXP/VMS machine (DEC's heap analyser is for VAX/VMS only)
> ?

The Heap Analyzer used to be VAX-only, but with the latest release of
VMS it also works on Alpha.  See Section 4.3 on page 4-6 of the VMS V7.0
New Features Manual (AA-QSBFA-TE, December 1995).

Larry Kilgallen
LJK Software




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-04-11  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-09  0:00 Memory leak in porting VAX/VMS -> AXP/VMS Mats Weber
1996-04-09  0:00 ` Chet
1996-04-10  0:00 ` Rick Gillmore
1996-04-11  0:00 ` Larry Kilgallen
1996-04-11  0:00 ` Mats Weber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox