how to clear/clean mbufs (network buffer space)?


 
Thread Tools Search this Thread
Top Forums Programming how to clear/clean mbufs (network buffer space)?
# 1  
Old 01-12-2005
how to clear/clean mbufs (network buffer space)?

When I worked with client-server (socket) programming, I encountered "the socket error# 10055" which means "No buffer space available". This might be a symptom of one or more applications that didn't return system resources (like memory) properly. Temporary solution was to reboot the machine to remedy the problem.

I need your technical help to provide me with a solution of how to clear/clean the network buffer space (mbufs) from the application standpoint to resolve this problem without rebooting the machine from time to time.

Thanks a lot for your help in advance.

DP
# 2  
Old 01-14-2005
Isn't this a problem with the way the application was written, not using malloc and free (etc) correctly or appropriately?

Quote:
#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);
# 3  
Old 01-15-2005
No buffer space available

Hi Neo,

Thank you much for your response. You were right about the full buffer space (mbufs) might have been caused by using the calls to "malloc()" or "calloc()" without freeing ("free()") the allocated memory.

However, in this case, the pointer to a structure has been created (without using malloc() or calloc()) at the beginning of an infinite for(;Smilie loop.

I now have a specific question about these two socket errors:
1. socket error 10055 (No buffer space available)
2. socket error 183 (?)

How do I fix the problems to resolve these two socket errors?

Thanks a lot.
DP
# 4  
Old 01-17-2005
DP !

You said , to free the allocation you need to reboot.
Does recycling of (shutdown and restart ) of application/process that causing memory problems not solving the problem ?
# 5  
Old 01-17-2005
As far as solution is concerned , you just see whether you can remove those memory leaks your application is causing.

'remedy' is one of the tools we used to detect memory leakages in an application.
I'm sure, a lot many should be available for the same.
# 6  
Old 01-18-2005
Bhargav,

Thanks for your inputs. Since the pointer(s) to structure were not created by using malloc() nor calloc(), so I could not use function free() to deallocate the memory. Instead, I just set the pointer(s) to zero at end of each time it goes thru the FOR loop. Do you think this should remove memory leaks and resolve the problem?

After re-testing for many hours, the socket error 183 seemed to be gone, but then it re-appeared as if the network buffer got jammed again.

Do you have any hints/help?

Thanks,
DP
# 7  
Old 01-18-2005
Is the application faster in the begining and becoming slower ? Do u see symptom like that ?

Quote:
However, in this case, the pointer to a structure has been created (without using malloc() or calloc()) at the beginning of an infinite for(; loop.
If no memory is allocated , the pointer might not be used in your code. Correct ?
Remove the pointer definition in the loop ( i guess it is definition) and see any improvement.

If this does not work , go thru your code where there are instances like this.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Clear standard input buffer for C program in Linux

Hello friends! i am writing a code in which i take inputs (numbers) from user and count the total number of positive, negative and zeros entered. I need to clear my standard input buffer before scanf() command. My compiler is completely ignoring the fflush(stdin) command. its not even showing any... (1 Reply)
Discussion started by: Abhishek_kumar
1 Replies

2. Programming

How to avoid 'No buffer space available' on C socket?

Hello everybody, Years ago i left in stand-by a project of mine where the main program was supposed to send thousands ARP frames over the socket as fast as it could; but because of a programming issue i couldn't continue it. 2 days ago I decided to solve that issue. The thing is, when the... (4 Replies)
Discussion started by: Zykl0n-B
4 Replies

3. Solaris

How to clear network socket port 17005?

:)Hi Solaris Experts, I am wondering whether it is possible to clear a network socket port 17005 left by Apache Tomcat/6.0.20 after having to terminate it forcefully, since it has run away due to remote JDBC resource contention on another server. A normal Tomcat stop / shutdown proves... (2 Replies)
Discussion started by: gjackson123
2 Replies

4. AIX

Need to clear the keyboard buffer

I'm running a ksh script that requires user interaction, and said users (myself among them) may get a little trigger happy and get ahead of ourselves and accidentally key in the wrong responses to future prompts in the script. Naturally, I'd like to prevent that, so how does one clear that... (0 Replies)
Discussion started by: Michael Mullig
0 Replies

5. HP-UX

How to clear keyboard buffer

Hi, How can i clear the command. Suppose using esc k i retrieved teh command, but for some reason I want to clear and type fresh one... how can i do that. thx (2 Replies)
Discussion started by: bang_dba
2 Replies

6. Shell Programming and Scripting

Clean up the space

Hi I just want to clean up the space in UNIX. Is there any special command that does this process or do I need to manually type the following rm <filename> Any help would be really appreciated. Thanks (2 Replies)
Discussion started by: bobby1015
2 Replies

7. Programming

Clear Serial Port Buffer Using iclear, iflush

Hello, I am having trouble clearing the serial port buffer using the iclear and iflush commands. The code runs without errors being returned, but when I check the buffer again there is still data. The only way I have so far is to read until there is nothing left in the buffer. Shouldn't one... (1 Reply)
Discussion started by: sammy-e
1 Replies

8. Shell Programming and Scripting

How to get just the word and clean the white space?

Hi, I need to check if the value returned by this query is bigger then 20000. It's not working! I think that the problem is that the return is with white spaces. How to solve this? Tks, Paulo Portugal. ####################### RESPOSTA=`/oracle/app/product/10.2/bin/sqlplus -s <<EOF / as... (2 Replies)
Discussion started by: paulofp
2 Replies

9. Shell Programming and Scripting

Space Clean Up Activity In Unix

Hi I am trying to develop a script so that whenever used % reaches 90% it will send an alert mail. Following is the script whic I am tryiing to implement but it show some error. code: #! /bin/ksh df -v | grep -i "/opt" | awk '{print $6}' > space if ] then echo "ALERT YOUR SPACE IS TOO... (6 Replies)
Discussion started by: pankajkrmishra
6 Replies

10. Linux

ssh: connect to host traviata port 22: No buffer space available

What does that mean? traviata being my distant host? What am i to do? (0 Replies)
Discussion started by: penguin-friend
0 Replies
Login or Register to Ask a Question