Regarding the maximum memory allocated by malloc() function on HP-UX B11.11


 
Thread Tools Search this Thread
Top Forums Programming Regarding the maximum memory allocated by malloc() function on HP-UX B11.11
# 1  
Old 06-25-2010
Regarding the maximum memory allocated by malloc() function on HP-UX B11.11

In a 'C' program,when I am trying to allocate memory with the help of malloc () function, it is allocating the memory up to a certain limit for e.g. in my case, it is 670 MB (approx). malloc() returns NULL if I allocate more than this amount of memory.When I tried
to allocate memory in chunks of 200MB, it failed when I exceed 670 MB.While I have sufficient amount of memory available (78 GB).

Actually I am getting CDRs from mediation for each subscriber and I have to allocate memory for each subscriber. There is a routine written inside the code where there is a structure containing Customer's id, contract id, cell number, Activation Date and Deactivation Date in memory. So to avoid this issue, I hardcoded the value of one member of the structure.But this is not a permanent solution. So please help me to figure out how to increase the amount of memory allocated by malloc().Your valuable feedback appreciated.
os is 64 bit.
getconf KERNEL_BITS ==>> 64
# 2  
Old 06-25-2010
Your user probably has limits set for the maximum memory usage. Check this by running
Code:
ulimit -a

The entry "memory" has the top limit (in KB) that you may use in a single program. Ask your system administrator to increase that.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to change allocated memory for a process?

Hello, I am running ubuntu 14.04 in a server with 32GB ram. Due to receiving "high load" errors during ssh connection, I took a look at what's happening from command line. I detected that 20GB of total memory was allocated to a program. Below you can see some initial part of installation... (4 Replies)
Discussion started by: baris35
4 Replies

2. Red Hat

KVM/Qemu allocated memory not showing in guest

So we have a RHEL 7.6 workstation with 128 gigs of ram. The OS sees all the ram and 80 cors (40 HT) We have 1 guest with 8 CPUs and 32gigs of ram running RHEL 7.6 workstation as well. We are trying to create another guest with 64 CPUs and 80 gigs of ram. We setup the system using... (0 Replies)
Discussion started by: joeg1484
0 Replies

3. Programming

Malloc function returning NULL

Hi All, I am using malloc function for allocating dynamic memory. When I am using below code on Linux server its working fine, but When I am trying the same code on HP UNIX server its returning NULL. below is a fragment of code in which it is giving problem. tmp = (format_tree... (4 Replies)
Discussion started by: Taher Saifuddin
4 Replies

4. Programming

./match_pattern.out: malloc(): memory corruption: 0x0000000013a11600 ***

Hi All, I have a simple code which does some computation by matching string patterns. In brief: 1. The code reads .dat and .txt files. 2. .dat files are huge text files and .txt files contain some important words. 3. I am just doing strstr to find the patterns. 4. The function returns the... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

5. HP-UX

how to find size of memory allocated to a pointer?

Hi, Am new to HP UX , is there a way to find out the size of memory allocated to a pointer on hp ux? For example we can use the _msize() on windows to find the size of memory allocated to a pointer . #include <stdio.h> #include <malloc.h> void main() { void *buffer; ... (0 Replies)
Discussion started by: Wkdunreal
0 Replies

6. Programming

Why memory allocated through malloc should be freed ?

Actually for a process to run it needs text, stack , heap and data segments. All these find a place in the physical memory. Out of these 4 only heap does exist after the termination of the process that created it. I want to know the exact reason why this happens. Also why the other process need to... (20 Replies)
Discussion started by: karthiktceit
20 Replies

7. AIX

amount of memory allocated to large page

We just set up a system to use large pages. I want to know if there is a command to see how much of the memory is being used for large pages. For example if we have a system with 8GB of RAm assigned and it has been set to use 4GB for large pages is there a command to show that 4GB of the *GB is... (1 Reply)
Discussion started by: daveisme
1 Replies

8. Programming

malloc gives the same memory to two different nodes. How to deal with it?

When allocating memory for two different nodes, the resulting memory are the same. Clearly, this will lead to a mistake. This happened in a function. And the process must be in a function. (gdb) p tree->list $43 = (node *) 0x8be4180 (gdb) p tree->list $44 = (node *) 0x8be4180 At the... (2 Replies)
Discussion started by: cdbug
2 Replies

9. Solaris

Memory allocated

Hi, How to find out what is the maximum memory allocated to TOMCAT server in SunOS 5.8? The Tomcat server crashes down during peak times.... Regards (1 Reply)
Discussion started by: baanprog
1 Replies

10. Programming

malloc function

Hello This is a simple program i carried out in my machine i dont know how it is working #include<alloc.h> #include<stdio.h> mian() { int *p,j; p= (int*)malloc(1); for(j=1;j<=580;j++) { *p=j; ++p; } p=p-580; for(j=1;j<=580;j++) { printf("%d",*p); } (7 Replies)
Discussion started by: rajashekaran
7 Replies
Login or Register to Ask a Question