Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gc.stat: bytes instead of words #3290

Closed
vicuna opened this issue Apr 8, 2002 · 1 comment
Closed

Gc.stat: bytes instead of words #3290

vicuna opened this issue Apr 8, 2002 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Apr 8, 2002

Original bug ID: 1065
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Martin Jambon
Version: 3.04
OS: PC/Linux
Submission from: pc-bioinfo1.ibcp.fr (193.51.160.63)

Sizes in Gc.stat seems to be expressed in bytes rather than in words.

Here is the creation of 10 arrays containing 1000000 zeros.
Its size should be approximately 10 * 1000000 = 10 M words or 40 Mbytes on a
32-bit architecture.
But heap_words = 40525824
(and `top' says that the memory usage of the process is 40Mbytes).

[pc-bioinfo1] ~ % ocaml
Objective Caml version 3.04

let a = Array.make_matrix 10 1000000 0;;

val a : int array array =
[|[|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0;
0; 0; 0; 0; 0; 0; 0; 0; 0; 0; ...|];
...|]

Gc.print_stat stdout;;

minor_words: 172342
promoted_words: 34080
major_words: 10086991
minor_collections: 4
major_collections: 16
heap_words: 40525824
heap_chunks: 12
live_words: 10082352
live_blocks: 15699
free_words: 49037
free_blocks: 15
largest_free: 44435
fragments: 67
compactions: 0

  • : unit = ()

@vicuna
Copy link
Author

vicuna commented Apr 8, 2002

Comment author: administrator

Full_Name: Martin Jambon

Sizes in Gc.stat seems to be expressed in bytes rather than in words.

Actually, only heap_words has this problem. It is fixed in the working
version.
Thank you for reporting this bug.

-- Damien

@vicuna vicuna closed this as completed Apr 8, 2002
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant