Alberto G. Corona | 27 Aug 18:20 2012
Picon

OS-independent auto-monitoring of a program to do things depending on resource usage at runtime

For a caching library, I need to know the runtime usage of memory of the  program and the total amount of memory, the total memory used by all the programs etc.


 I need not do profiling or monitoring but to do different things inside my program depending on memory usage.

The search is difficult because all searches go to profiling utilities which I don´t need.

Are there some  portable way to to this? . The various monitoring libraries indicates that there are ways to do it, but they seem not to allow  runtime "internal automonitoring"
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Joachim Breitner | 27 Aug 20:12 2012
Picon

Re: OS-independent auto-monitoring of a program to do things depending on resource usage at runtime

Hi,

Am Montag, den 27.08.2012, 18:20 +0200 schrieb Alberto G. Corona :
> For a caching library, I need to know the runtime usage of memory of
> the  program and the total amount of memory, the total memory used by
> all the programs etc.
> 
> 
>  I need not do profiling or monitoring but to do different things
> inside my program depending on memory usage.
> 
> The search is difficult because all searches go to profiling utilities
> which I donĀ“t need.
> 
> 
> Are there some  portable way to to this? . The various monitoring
> libraries indicates that there are ways to do it, but they seem not to
> allow  runtime "internal automonitoring"

you can use the GHC.Stats module, see
http://www.haskell.org/ghc/docs/latest/html/libraries/base/GHC-Stats.html, and remember to
pass +RTS -T to the program, or -with-rtsopts=-T to the compiler.

Greetings,
Joachim

--

-- 
Joachim "nomeata" Breitner
  mail <at> joachim-breitner.de  |  nomeata <at> debian.org  |  GPG: 0x4743206C
  xmpp: nomeata <at> joachim-breitner.de | http://www.joachim-breitner.de/

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Alberto G. Corona | 27 Aug 20:39 2012
Picon

Re: OS-independent auto-monitoring of a program to do things depending on resource usage at runtime

Joachim:


Thanks a lot

2012/8/27 Joachim Breitner <mail <at> joachim-breitner.de>
Hi,

Am Montag, den 27.08.2012, 18:20 +0200 schrieb Alberto G. Corona :
> For a caching library, I need to know the runtime usage of memory of
> the  program and the total amount of memory, the total memory used by
> all the programs etc.
>
>
>  I need not do profiling or monitoring but to do different things
> inside my program depending on memory usage.
>
> The search is difficult because all searches go to profiling utilities
> which I don´t need.
>
>
> Are there some  portable way to to this? . The various monitoring
> libraries indicates that there are ways to do it, but they seem not to
> allow  runtime "internal automonitoring"

you can use the GHC.Stats module, see
http://www.haskell.org/ghc/docs/latest/html/libraries/base/GHC-Stats.html, and remember to pass +RTS -T to the program, or -with-rtsopts=-T to the compiler.

Greetings,
Joachim

--
Joachim "nomeata" Breitner
  mail <at> joachim-breitner.de  |  nomeata <at> debian.org  |  GPG: 0x4743206C
  xmpp: nomeata <at> joachim-breitner.de | http://www.joachim-breitner.de/


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Gregory Collins | 28 Aug 14:00 2012
Picon

Re: OS-independent auto-monitoring of a program to do things depending on resource usage at runtime

For a concrete example of this at work, see Johan's ekg package: http://hackage.haskell.org/package/ekg


G

On Mon, Aug 27, 2012 at 8:12 PM, Joachim Breitner <mail <at> joachim-breitner.de> wrote:
Hi,

Am Montag, den 27.08.2012, 18:20 +0200 schrieb Alberto G. Corona :
> For a caching library, I need to know the runtime usage of memory of
> the  program and the total amount of memory, the total memory used by
> all the programs etc.
>
>
>  I need not do profiling or monitoring but to do different things
> inside my program depending on memory usage.
>
> The search is difficult because all searches go to profiling utilities
> which I don´t need.
>
>
> Are there some  portable way to to this? . The various monitoring
> libraries indicates that there are ways to do it, but they seem not to
> allow  runtime "internal automonitoring"

you can use the GHC.Stats module, see
http://www.haskell.org/ghc/docs/latest/html/libraries/base/GHC-Stats.html, and remember to pass +RTS -T to the program, or -with-rtsopts=-T to the compiler.

Greetings,
Joachim

--
Joachim "nomeata" Breitner
  mail <at> joachim-breitner.de  |  nomeata <at> debian.org  |  GPG: 0x4743206C
  xmpp: nomeata <at> joachim-breitner.de | http://www.joachim-breitner.de/


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe




--
Gregory Collins <greg <at> gregorycollins.net>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane