473,466 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Cannot allocate memory

44 New Member
hi,

I have created a echo server which accepts request from client , for each client request processing my server creates new thread but after creating 305 thread it says "Cannot allocate memory" Errocode = 12.

I have close socket of both sides as well as use PTHREAD_CREATE_DETACHED flage while thread creation.

I am working on CentOS (linux) and using pthread_create() function for thread creation.

your help will be appriciated.

Thanks
Abhinay
Nov 3 '08 #1
5 5689
Banfa
9,065 Recognized Expert Moderator Expert
It would appear that your system has run out of memory. If you think this is unlikely then the first thing to work out is how much memory you have actually allocated and how much memory each thread allocates.
Nov 3 '08 #2
donbock
2,426 Recognized Expert Top Contributor
Do you ever free any memory?
Nov 3 '08 #3
Abhinay
44 New Member
Do you ever free any memory?

Thanks for your reply,
My server thread only receive transaction ( using socket ) information and insert into database after that I close socket ( from both side ) and terminate the corresponding thread. I have not allocated any memory using "new" operator in my code.
Nov 4 '08 #4
donbock
2,426 Recognized Expert Top Contributor
I have not allocated any memory using "new" operator in my code.
You must be allocating per-thread memory somehow, or else you wouldn't be getting an out-of-memory error after the 305th thread.
Nov 5 '08 #5
Abhinay
44 New Member
Thank all of you for helping me,
I have solve issue using connection pool.

Thank you
Abhinay
Nov 6 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

37
by: Curt | last post by:
If this is the complete program (ie, the address of the const is never taken, only its value used) is it likely the compiler will allocate ram for constantA or constantB? Or simply substitute the...
4
by: Franklin Lee | last post by:
Hi All, I use new to allocate some memory,even I doesn't use delete to release them. When my Application exit, OS will release them. Am I right? If I'm right, how about Thread especally on...
5
by: lixiaoyao | last post by:
hi all I use matrix & vector function to allocate the space myself in c, typedef struct matrix_array newdata; struct matrix_array{ float **sy,*sxx; }; newdata ndata;//new data struct...
22
by: Smutny30 | last post by:
Hello, I am preparing a database that will store 10 n * GBs - 100 n * GBs of data. I calculated to have 1,2 GB of bufferpools. I run the DB2 v. 8.2.1 alone on 4 GB box. I obtain : ...
3
by: jcgeorge | last post by:
I am getting this: RETCODE : ZRC=0x8B59000D=-1957101555=SQLKF_NOMEM_BUFFER_HEAP "No memory available in 'FCMBP Heap'" DIA8300C A memory heap error has occurred. and this FUNCTION: DB2 UDB,...
12
by: gc | last post by:
I am writing a function that given nx1 vector a and a nx1 b solves a system of equations f(a,c)=b for a nx1 c. While writing the function: 1] Should I allocate the memory for c within the...
1
by: rveloso | last post by:
Hi all, i'm having a really nasty problem with popen. I have the following code : --------------------- .... FILE *PD; .... sprintf(fname,"/usr/bin/gzip -dc %s/%s",dirname,dp->d_name); .......
2
by: lovecreatesbea... | last post by:
If the built-in operator keyword new doesn't allocate memory on heap and it calls global operator new (::operator new) or class member operator new to do that. What are the two kinds of operator...
5
by: Siegfried Heintze | last post by:
On line 5 of the program below I get the error message in the subject line. (1) How may I correct it? (2) How may I enhance my Arr class to work with a foreach statement? (3) In C++ I can pass...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.