comp.lang.ada
 help / color / mirror / Atom feed
* Can I get Buffer Contents of unreleased memory when running gnatmem?
@ 2019-07-02 13:14 Petter Fryklund
  2019-07-02 13:44 ` joakimds
  0 siblings, 1 reply; 4+ messages in thread
From: Petter Fryklund @ 2019-07-02 13:14 UTC (permalink / raw)


Hi all,
I'm trying to eliminate memory leaks. I find gnatmem very useful, but now I'm having problems identifying the culprit(s). Is there anyway to find out the contents of the unreleased memory?

Regards,
Petter 

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

* Re: Can I get Buffer Contents of unreleased memory when running gnatmem?
  2019-07-02 13:14 Can I get Buffer Contents of unreleased memory when running gnatmem? Petter Fryklund
@ 2019-07-02 13:44 ` joakimds
  2019-07-05  5:48   ` Petter Fryklund
  0 siblings, 1 reply; 4+ messages in thread
From: joakimds @ 2019-07-02 13:44 UTC (permalink / raw)


Den tisdag 2 juli 2019 kl. 15:14:08 UTC+2 skrev Petter Fryklund:
> Hi all,
> I'm trying to eliminate memory leaks. I find gnatmem very useful, but now I'm having problems identifying the culprit(s). Is there anyway to find out the contents of the unreleased memory?
> 
> Regards,
> Petter

Hi Petter,

Don't know about gnatmem but Valgrind is nice for finding memory leaks in Linux applications. Another alternative for finding memory leaks is using GNAT.Debug_Pools:
https://www.adacore.com/gems/gem-77

My guess is that you already know of these alternatives but mention them anyways.

Best regards,
Joakim


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

* Re: Can I get Buffer Contents of unreleased memory when running gnatmem?
  2019-07-02 13:44 ` joakimds
@ 2019-07-05  5:48   ` Petter Fryklund
  2019-07-05 10:12     ` AdaMagica
  0 siblings, 1 reply; 4+ messages in thread
From: Petter Fryklund @ 2019-07-05  5:48 UTC (permalink / raw)


Hi Joakim,
I'm chasing the leakages in host environment (w7) since the targets (linux) are very occupied. gnatmem is actually quite good.

Currently some culprits are overriding Finalize without disposing the instance it self. I thought that that would be automatic, but it's not. A typical override is a null statement. Maybe that is what we want since the object creating an instance is usually not the one that shall remove it. A majority of the instances are messages that are created when received and forwarded to different handlers.

Regards,
Petter 

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

* Re: Can I get Buffer Contents of unreleased memory when running gnatmem?
  2019-07-05  5:48   ` Petter Fryklund
@ 2019-07-05 10:12     ` AdaMagica
  0 siblings, 0 replies; 4+ messages in thread
From: AdaMagica @ 2019-07-05 10:12 UTC (permalink / raw)


Am Freitag, 5. Juli 2019 07:48:44 UTC+2 schrieb Petter Fryklund:
> Currently some culprits are overriding Finalize without disposing the instance it self. I thought that that would be automatic, but it's not.

Finalization and storage deallocation are two different things.

Dynamic Storage Allocation:

When the lifetime of an access type ends, all still existing objects referenced via pointers of this type are finalized in an order unspecified by the language.

The associated storage, however, is only freed if the attribute Storage_Size is defined for it.


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

end of thread, other threads:[~2019-07-05 10:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02 13:14 Can I get Buffer Contents of unreleased memory when running gnatmem? Petter Fryklund
2019-07-02 13:44 ` joakimds
2019-07-05  5:48   ` Petter Fryklund
2019-07-05 10:12     ` AdaMagica

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