My test here shows that the handle grows consistently, and it will not be automatically collected after waiting for 10 hours. It shows that the handle will not be collected even when calling gc.collect(). Why? My webservice is called in multiple threads. Is it related to multiple threads? Confused, please continue to give some comments
You can try, in the test environment, a single client calls successively, can it release the handle?
Yes, concurrency control may be added to the code
No, there are unreleased handles in the code? If the file stream is not closed, etc.
Make a helloworld webservice. The method signature is the same as your webservice. It only returns a string. After using your client for multiple calls, does the handle keep increasing? Can you use gc.collect() to release it? Can the number of handles decrease?
TO:crabheroDo you suspect that there is a problem with the server-side WEB service? This should not be because I see that a program of another colleague calls a web service (which is not the same as my call). I don't know. Is it the problem of adding less configuration in the application configuration?
Do you suspect that there is a problem with the server-side WEB service?
-----------------------------------
No, it may be that the resources of your client code have not been released. If you call helloworld, the number of client handles cannot be reduced. It may be a problem with your environment. If it can be reduced, it may be a problem with your client code.
Use simple helloword to test the same handle growth, and the same on other machines, don’t the test program you write grow?
Service1 client=new Service1();
String str=client.HelloWorld();
if ("Hello World"==str)
{
return 1;
}
Don’t the test programs you write grow?
----------------------
It will grow, but it will drop by itself after multiple calls, keep it at a certain number, and use gc.collect() to immediately drop