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

Isn't this a problem with the way the application was written, not using malloc and free (etc) correctly or appropriately?

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(;:wink: 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

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 ?

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.

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

Is the application faster in the begining and becoming slower ? Do u see symptom like that ?

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.

Yes, the network has become a little slow. I just couldn't detect to see how slow it was.

However, these problems (error 10055: no buffer space; error 183:?) seemed to be known issues on windows 2000 platforms. The same codes run on windows XP did not cause these problems.

In general, I think these are network-related problems on windows 2000. I hope to be able to access the network buffer (mbufs) to clear/clean to see if the problems are resolved.

Thanks,
DP