Memory re-allocation Failure HP-UX for C++ module


 
Thread Tools Search this Thread
Operating Systems HP-UX Memory re-allocation Failure HP-UX for C++ module
# 1  
Old 07-10-2008
Memory re-allocation Failure HP-UX for C++ module

HI

I am getting core dump with "Memory re-allocation Failure" error can any one help me to get the possible reasons of getting this type of error, I am running the C++ code on HP-UX.

Please help me thanx in advance

Last edited by gyanusoni; 07-10-2008 at 09:10 AM..
# 2  
Old 07-11-2008
Pushing back several hundred thousand data items onto a vector. C++ resizes storage dynamically behind the scenes for a lot of STL templates. vector template class being one.

Where v is a vector:
Quote:
v.push_back(e); Adds e to end of v. Expands v if necessary.
Check v.capacity() or better yet call v.reserve(n) ahead of time. v.max_szie() will tell you if you are getting close to the implementation limit.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Memory allocation problem

I am using ubuntu. I have written a program to calculate prime factors. it works perfectly fine till entered number is less than 9989 (or so ) but when one enters a number higher than that, for example 15000, it does not work. Can anyone guide me whats the problem ? although new codes are welcome,... (2 Replies)
Discussion started by: Abhishek_kumar
2 Replies

2. Solaris

Memory allocation failure for pkgadd in solaries.

On installing a package in one of the solaries VM, i am getting the below error, pkgadd: ERROR: memory allocation failure, errno=0 Installation of <CSCObac> failed. We also collect some stat in the troubleshooting process but could not figure out why. SNTDCAUJD04FD2# df -h Filesystem size... (1 Reply)
Discussion started by: Kiran Reddy D
1 Replies

3. Programming

C++/ROOT Memory Allocation?

Hello, I am new to C++ programming, so I'm still getting a feel for things. I recently wrote a simple C++ program (to be used as a ROOT Macro) to conduct a statistical analysis of a varied version of the Monty Hall problem (code below). Basically, the programs runs a few simple calculations to... (7 Replies)
Discussion started by: Tyler_92
7 Replies

4. Shell Programming and Scripting

memory allocation to a variable

hello all.. i'm a beginner in shell scripting. I need to know what is really happening when we are creating a variable in shell scripting? how memory is allocated for that variable? (3 Replies)
Discussion started by: aarathy
3 Replies

5. Programming

Dynamic Memory Allocation

Hello Guys I have a small confusion in the dynamic memory allocation concept. If we declare a pointer say a char pointer, we need to allocate adequate memory space. char* str = (char*)malloc(20*sizeof(char)); str = "This is a string"; But this will also work. char* str = "This... (2 Replies)
Discussion started by: tene
2 Replies

6. Programming

Memory allocation in C

Hi Experts I need some help in static memory allocation in C. I have a program in which I declared 2 variables, one char array and one integer. I was little surprised to see the addresses of the variables. First: int x; char a; printf("%u %u\n', &x, a); I got the addresses displayed... (2 Replies)
Discussion started by: unx_freak
2 Replies

7. HP-UX

HP-UX memory usage allocation

Hi all, I have a HP-UX Server with 4 gigabytes of physical RAM. When I use the 'Glance' utility to see what my memory utilization is, my memory usage shows up maxed out at 99%. I shut off all the known processes that I'm running on that box and the memory utilization is still at 78% (with Swap... (3 Replies)
Discussion started by: dehuang83
3 Replies

8. UNIX for Dummies Questions & Answers

HP-UX memory usage allocation

Hi all, I have a HP-UX Server with 4 gigabytes of physical RAM. When I use the 'Glance' utility to see what my memory utilization is, my memory usage shows up maxed out at 99%. I shut off all the known processes that I'm running on that box and the memory utilization is still at 78% (with Swap... (1 Reply)
Discussion started by: dehuang83
1 Replies

9. UNIX for Advanced & Expert Users

threads and memory allocation

Hello! First of all, forgive me for bad English. When I starts new thread (pthread_create), system allocates some memory for it (for example, for thread's stack). I wonder when does it deallocate this memory? The problem is that I have a program which sometimes creates new threads and sometimes... (3 Replies)
Discussion started by: prankster
3 Replies

10. UNIX for Dummies Questions & Answers

memory allocation

I would like to know how I could allocate some more memory to a process. Please note that I am not the root user. (1 Reply)
Discussion started by: sagar
1 Replies
Login or Register to Ask a Question