- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- memory question
Operating System - HP-UX
1753925
Members
9255
Online
108810
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2003 04:04 AM
тАО10-20-2003 04:04 AM
memory question
How is memory allocated when starting up a Cobol, C, or any other language program. Is it allocated in certain areas (partitions) or is the memory allocated as is needed by the program. Is this memory taken from RAM or another pool of memory. Currently I have 1.7 Gig of ram (determined from glanceplus and the 'top' command)...
thanks...Jay
thanks...Jay
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2003 04:20 AM
тАО10-20-2003 04:20 AM
Re: memory question
This question is really too general to answer. It depends upon many factors and to an extent depends upon is the code 32-bit or 64-bit.
Your executable can de roughly divided into 3 sections (text -- the actual instructions which might be shared with other processes; data --- just what it sounds like; and bss -- essentially uninitialized data); it gets more complicated because local variables (i.e. auto storage class varies local to a function) are generally allocated from the stack while static storage class local variables are in the 'data' segment. In 32-bit world each of these fall , by default, into separate 1GB quadrants. There is also 'shared memory' which can be shared among a group of related processes. I should also mention that processes can dynamically allocate memory 'on the fly' using the sbrk() system call -- which is usually invoked from the higher-level malloc() and related funcions. Dynamic memory allocation is extremely common is languages like C or C++ but less common in languages like COBOL.
Note that the process really doesn't care how much physical memory you have --- although from a performance perspective it does matter --- but only upon the amount of virtual memory (RAM + SWAP) available. If a given program cannot load, it might be because the kernel parameters maxtsiz (text), maxdsiz (data), or maxssiz (stack) limits are exceeded. These parameters also have 64-bit counterparts that apply to 64-bit processes.
Your executable can de roughly divided into 3 sections (text -- the actual instructions which might be shared with other processes; data --- just what it sounds like; and bss -- essentially uninitialized data); it gets more complicated because local variables (i.e. auto storage class varies local to a function) are generally allocated from the stack while static storage class local variables are in the 'data' segment. In 32-bit world each of these fall , by default, into separate 1GB quadrants. There is also 'shared memory' which can be shared among a group of related processes. I should also mention that processes can dynamically allocate memory 'on the fly' using the sbrk() system call -- which is usually invoked from the higher-level malloc() and related funcions. Dynamic memory allocation is extremely common is languages like C or C++ but less common in languages like COBOL.
Note that the process really doesn't care how much physical memory you have --- although from a performance perspective it does matter --- but only upon the amount of virtual memory (RAM + SWAP) available. If a given program cannot load, it might be because the kernel parameters maxtsiz (text), maxdsiz (data), or maxssiz (stack) limits are exceeded. These parameters also have 64-bit counterparts that apply to 64-bit processes.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2003 04:22 AM
тАО10-20-2003 04:22 AM
Re: memory question
Memory is allocated depending on how the Cobol, C or other language program asks for it.
For example, using the malloc() C call you can request just a huge chunk of memory, from 1MB to hundreds of MB.
If you write a simple C program which simply declares a string variable of 80 characters then it will use that much memory, plus some more depending on how many lines of code you have.
Or if you request shared memory then its of a fixed size, and it shows using the ipcs command (ipcs -m).
All of the above are taken from RAM. As these programs get loaded into memory free ram goes down (vmstat command shows free pages of memory). The goal will be to ensure you never run out of memory, or else performance degrades signicicantly so keep an eye on the free total from vmstat.
For example, using the malloc() C call you can request just a huge chunk of memory, from 1MB to hundreds of MB.
If you write a simple C program which simply declares a string variable of 80 characters then it will use that much memory, plus some more depending on how many lines of code you have.
Or if you request shared memory then its of a fixed size, and it shows using the ipcs command (ipcs -m).
All of the above are taken from RAM. As these programs get loaded into memory free ram goes down (vmstat command shows free pages of memory). The goal will be to ensure you never run out of memory, or else performance degrades signicicantly so keep an eye on the free total from vmstat.
Im from Palmerston North, New Zealand, but somehow ended up in London...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2003 04:25 AM
тАО10-20-2003 04:25 AM
Re: memory question
Hi:
See attached Memory Management White Paper and refer to /usr/share/docs/mem_mgt.txt
See attached Memory Management White Paper and refer to /usr/share/docs/mem_mgt.txt
Support Fatherhood - Stop Family Law
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP