Re: How to reduce Zero Initialised region.



Ajai Jose wrote:
On Jan 31, 4:48 pm, "Samuel Stearley" <nya...@xxxxxxxxx> wrote:

1. Am I right in doing this (passing pointer instead of making the data structure static) ?

That will make the executable larger. How much increase can be
tolerated?

I mean passing an extra parameter to a function might increase code
size(text segment). Some additional code for sending the parameter
during function prolog. that is all the penalty right ?
but it will free some space of the ZI region when it comes to big
arrays.

Why do you want to reduce the size of only zero-initialized RAM?

I assume that code and data are in separate memory spaces. Usually, though, the zero-initialized static data area, data area allocated to automatic variables (normally on a stack), and the heap all share the same physical memory, which is divided according to the program usage (although there are cases in which some memory is battery-backed, which other is not).

You can reduce RAM requirements by replacing local static variables with automatic variables if the value does not need to be carried from one invocation to another. That allows the memory to be shared among several functions that execute at different times. There is no need to pass pointers if there is no data involved.

--
Thad
.



Relevant Pages

  • [PATCH 34/45] KVM: ia64: Re-organize data sturure of guests data area
    ... Support more vcpus and memory, 128 vcpus and 256G memory are supported ... kvm guest's data area looks as follow: ... To support large memory, needs to increase the size of p2m. ...
    (Linux-Kernel)
  • Re: IBM mainframe history, was Floating-point myths
    ... What OS/360 did was to to start a batch program, called TSO. ... The program was loaded into memory for the duration. ... The data area of the TSO program was divided into several areas which could be used for loading "user" work into. ... So the interactive users competed for memory only with other interactive users but that TSO itself, and thus all interactive users competed for CPU time with whatever other batch jobs were running at the time. ...
    (comp.arch)
  • Re: IBM mainframe history, was Floating-point myths
    ... Or is the extended memory management on a ... What OS/360 did was to to start a batch program, called TSO (Time ... The data area of the TSO program was divided into several areas which ... competed for memory only with other interactive users but that TSO ...
    (comp.arch)
  • msync - using MS_SYNC and MS_ASYNC interleaved
    ... which are typically mapped into 2 different memory areas (data area + ... After changing the memory contents a call to ... to call msync twice. ... Und note too, that the memory address range for the two msyncs ...
    (comp.os.linux.development.system)