09-09-2015
The amount of memory available on the system varies from 256MB to 4GB. This is because customers using my program has systems with different memory sizes.
1) I have a clarification to understand the AIX mem mgmt behavior. Suppose that I do not set the LDR_CNTRL=maxdata flag in which case my program can use max. of 256MB, right? Now say my program has done malloc/calloc and reached 256MB. If my program again wants more memory using calloc/malloc, what happens? Will it get addtional memory after some memory are swapped to swap space? And if no swap space is available I guess it would cause SEGV.
2) When you said "using shared memory ..." what did you mean?
3) The additional option, is it MALLOCOPTIONS=disclaim? We've tried this but makes the process very slow. Any other option?
Thanks
-KPRajesh
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
I'm thinking of buying a Maxdata laptop 3100x. Only problem is that I'll need to run LINUX on it, and I've been warned that some machines don't run UNIX due to problems with their graphics cards. I contacted Maxdata, who say they've never tested their machines for UNIX-compatibility, which... (1 Reply)
Discussion started by: perturbed
1 Replies
2. AIX
Please can anyone help me in my problem
my problem is
i have AIX 5.3 and We need 1 GB of data segment size available and we found To set the data segment size to 1 GB, set the LDR_CNTRL variable to LDR_CNTRL=MAXDATA=0x40000000@DSA.
But after we set it and check with command “$ dump -X64 -o... (0 Replies)
Discussion started by: mghazaly
0 Replies
3. Shell Programming and Scripting
hi all,
is there somebody that know how can I set an permanently option for the lynx text browser?
The reason is if I open some URL's and type my login infos
then lynx show follow message:
P)roceed, use G)ET or C)ancel
Server asked for 301 redirection of POST content to
URL: The UNIX... (1 Reply)
Discussion started by: research3
1 Replies
4. Solaris
Hi all,
I don't want to enter below command on solaris every time.
How do i permanently set this command on Solaris.
I know that this operation is a piece of cake on redhat because there is a /etc/rc.local file on it.
But Solaris ????
bash-3.00#export PS1="\e (2 Replies)
Discussion started by: getrue
2 Replies
5. Red Hat
On a test server running CentOS 6, I try to permanently set the owner, group and mode of disk devices for use with a DB2 database. For this I created an udev rule file /etc/udev/rules.d/99-db2.rules:
KERNEL=="sdb*", OWNER="db2usrl1", GROUP="db2adml1", MODE="0600"
After a reboot, the owner and... (4 Replies)
Discussion started by: hergp
4 Replies
6. UNIX for Advanced & Expert Users
I thought I would share gmail revert to old look permanently. I am sure I am not the only one annoyed by the new look.
Install Stylish extension
Choose the Stylish UserStyle that you want.
I know The Return of Old Gmail and gmail-b2b both work but I prefer gmail-b2b since I think it looks... (0 Replies)
Discussion started by: cokedude
0 Replies
7. Red Hat
Hi,
Since everything is doable in Linux so far, what is the ability of changing a spicifc service name permanently. e.g. I want to change the network service name to connection, so I can use chkconfig command as follow:
chkconfig connection off --level 5 # for disabling network service in... (7 Replies)
Discussion started by: leo_ultra_leo
7 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have as Solaris 10 (x86) system. I want to set the maximum memory for the user
But the following comaand is valid only till next reboot.Pls let me know how to make it permanenent.
prctl -n project.max-shm-memory -r -v 4G -i project 3 (6 Replies)
Discussion started by: Rossdba
6 Replies
9. Solaris
Hi ,
How to set autolist permanently in Solaris 10 (2 Replies)
Discussion started by: ankit.padhiyar
2 Replies
10. Red Hat
Hi Guys,
I'm trying to install Oracle Database on to Oracle Linux 7.6 but when
the database install package checks the OS set-up, it keeps on failing
on the soft limits for the stack. It's default value is 8192 but I'm trying
to set it to 10240.
This is what I added to... (2 Replies)
Discussion started by: ASGR
2 Replies
LEARN ABOUT REDHAT
malloc
MALLOC(3) Linux Programmer's Manual MALLOC(3)
NAME
calloc, malloc, free, realloc - Allocate and free dynamic memory
SYNOPSIS
#include <stdlib.h>
void *calloc(size_t nmemb, size_t size);
void *malloc(size_t size);
void free(void *ptr);
void *realloc(void *ptr, size_t size);
DESCRIPTION
calloc() allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory. The memory is
set to zero.
malloc() allocates size bytes and returns a pointer to the allocated memory. The memory is not cleared.
free() frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Oth-
erwise, or if free(ptr) has already been called before, undefined behaviour occurs. If ptr is NULL, no operation is performed.
realloc() changes the size of the memory block pointed to by ptr to size bytes. The contents will be unchanged to the minimum of the old
and new sizes; newly allocated memory will be uninitialized. If ptr is NULL, the call is equivalent to malloc(size); if size is equal to
zero, the call is equivalent to free(ptr). Unless ptr is NULL, it must have been returned by an earlier call to malloc(), calloc() or
realloc().
RETURN VALUE
For calloc() and malloc(), the value returned is a pointer to the allocated memory, which is suitably aligned for any kind of variable, or
NULL if the request fails.
free() returns no value.
realloc() returns a pointer to the newly allocated memory, which is suitably aligned for any kind of variable and may be different from
ptr, or NULL if the request fails. If size was equal to 0, either NULL or a pointer suitable to be passed to free() is returned. If real-
loc() fails the original block is left untouched - it is not freed or moved.
CONFORMING TO
ANSI-C
SEE ALSO
brk(2), posix_memalign(3)
NOTES
The Unix98 standard requires malloc(), calloc(), and realloc() to set errno to ENOMEM upon failure. Glibc assumes that this is done (and
the glibc versions of these routines do this); if you use a private malloc implementation that does not set errno, then certain library
routines may fail without having a reason in errno.
Crashes in malloc(), free() or realloc() are almost always related to heap corruption, such as overflowing an allocated chunk or freeing
the same pointer twice.
Recent versions of Linux libc (later than 5.4.23) and GNU libc (2.x) include a malloc implementation which is tunable via environment vari-
ables. When MALLOC_CHECK_ is set, a special (less efficient) implementation is used which is designed to be tolerant against simple
errors, such as double calls of free() with the same argument, or overruns of a single byte (off-by-one bugs). Not all such errors can be
protected against, however, and memory leaks can result. If MALLOC_CHECK_ is set to 0, any detected heap corruption is silently ignored;
if set to 1, a diagnostic is printed on stderr; if set to 2, abort() is called immediately. This can be useful because otherwise a crash
may happen much later, and the true cause for the problem is then very hard to track down.
Linux follows an optimistic memory allocation strategy. This means that when malloc() returns non-NULL there is no guarantee that the mem-
ory really is available. In case it turns out that the system is out of memory, one or more processes will be killed by the infamous OOM
killer.
GNU
1993-04-04 MALLOC(3)