how many bytes per $scalar, $ref2something and the like?
From: Ralf Wahner (Ralf.Wahner_at_iwr.uni-heidelberg.de)
Date: 05/24/04
- Next message: JDS: "Re: Cannot launch simple applications (notepad, java) using Apache and PERL(CGI)"
- Previous message: Tim Hammerquist: "Re: Cannot launch simple applications (notepad, java) using Apache and PERL(CGI)"
- Next in thread: ! aaa: "Re: how many bytes per $scalar, $ref2something and the like?"
- Reply: ! aaa: "Re: how many bytes per $scalar, $ref2something and the like?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 May 2004 01:41:42 -0700
Dear Masters of Perl
I've been searching for a long time for an answer on the question how much
memory the data structures of Perl require. Usually, say, a floating point
number of double precision gets eight bytes and an integer four bytes.
So far I couldn't find out, how many bytes Perl takes to store
- a scalar $a
- a reference to a scalar, array, hash or subroutine
Since arrays and hashes consist of scalars themselves, this should be
sufficient for estimating the memory usage of arbitrary data structures.
Background: I'm writing my diploma thesis on numerical mathematics. At the
moment I'm finishing a grid generator. Since the program needs a vast amount
of data in order to write the grid files the memory usage grows very fast
for huge grids. It appears that my program either produces a memory leak or
actually runs out of memory. In order to find the reason it would be a great
help to estimate the memory usage of the data structures. Unfortunately, I
couldn't find a hint on how much memory Perl allocates for its data types.
Any tip is gratefully appreciated. Thanks in advance,
Ralf
- Next message: JDS: "Re: Cannot launch simple applications (notepad, java) using Apache and PERL(CGI)"
- Previous message: Tim Hammerquist: "Re: Cannot launch simple applications (notepad, java) using Apache and PERL(CGI)"
- Next in thread: ! aaa: "Re: how many bytes per $scalar, $ref2something and the like?"
- Reply: ! aaa: "Re: how many bytes per $scalar, $ref2something and the like?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|