caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* controler la taille du tas
@ 1999-03-10  8:15 ` Pierre CREGUT - FT.BD/CNET/DTL/MSV
  1999-03-11  0:52   ` doligez
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre CREGUT - FT.BD/CNET/DTL/MSV @ 1999-03-10  8:15 UTC (permalink / raw)
  To: caml-list

Y a t'il un moyen (même détourné) pour imposer que la taille du tas d'un 
programme CAML ne passe jamais en dessous d'un certain seuil. 
Je veux que même si la mémoire est inutilisée, le GC ne la relache pas 
(sinon, une solution au problème est d'allouer un tableau global de la taille 
du seuil voulu, mais ca n'a pas grand intérêt).

Ce que je cherche a faire, c'est m'assurer que même si une autre application
(gloutonne) sature la mémoire, elle ne parviendra pas à empêcher le programme
CAML de fonctionner si je connais ses besoins en mémoire et si j'ai pris 
la précaution de lui allouer suffisemment d'espace.

Pierre Crégut

(En fait il manque un parametre dans le type Gc.control. Une solution
 est peut être de mettre major_heap_increment a la valeur du seuil, mais 
 c'est une solution brutale si l'estimation est fausse.)

===[translation]===

Is there a way (even a weird one) to enforce that the size of the heap of 
a Caml program will never shrink under a given threshold ? I want 
that the garbage collector takes all the memory allocated and 
does not release it even if it is unused.

I want to be sure that even if another program tries to control all the 
available memory, it will not manage to strangle my Caml application
if I know the worst memory requirements of the CAML program.


-- 
Pierre Cregut - pierre.cregut@cnet.francetelecom.fr - +33 2 96 05 16 28
FT.CNET - DTL/MSV - 2 avenue Pierre Marzin - 22307 Lannion Cedex - France




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

* Re: controler la taille du tas
  1999-03-10  8:15 ` controler la taille du tas Pierre CREGUT - FT.BD/CNET/DTL/MSV
@ 1999-03-11  0:52   ` doligez
  0 siblings, 0 replies; 2+ messages in thread
From: doligez @ 1999-03-11  0:52 UTC (permalink / raw)
  To: caml-list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]


>From: "Pierre CREGUT - FT.BD/CNET/DTL/MSV" <pierre.cregut@cnet.francetelecom.fr>

>Y a t'il un moyen (même détourné) pour imposer que la taille du tas=
> d'un
>programme CAML ne passe jamais en dessous d'un certain seuil.
>Je veux que même si la mémoire est inutilisée, le GC ne la relache =
>pas
>(sinon, une solution au problème est d'allouer un tableau global de la =
>taille
>du seuil voulu, mais ca n'a pas grand intérêt).

C'est simple:
1. allouer un objet de la taille voulue (par exemple une chaine)
2. ne pas garder de pointeur sur cet objet
3. declencher un GC
4. ne pas utiliser le compactage


>===[translation]===
>
>Is there a way (even a weird one) to enforce that the size of the heap of=
>
>a Caml program will never shrink under a given threshold ? I want
>that the garbage collector takes all the memory allocated and
>does not release it even if it is unused.

1. allocate a big object (for example a string)
2. don't keep any pointer to the object
3. call the GC
4. don't use compaction

-- Damien




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

end of thread, other threads:[~1999-03-11 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <pierre.cregut@cnet.francetelecom.fr>
1999-03-10  8:15 ` controler la taille du tas Pierre CREGUT - FT.BD/CNET/DTL/MSV
1999-03-11  0:52   ` doligez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).