locked
Web service error? [There has been an overflow or underflow in GC Memory pressure] RRS feed

  • 問題

  • Hi all,

     

    I hosted one web service application, and there are web methods to update/insert something into MS SQL 2005 database.

     

    I then create another Win Application and calling this Web Service in a batch on more than 3000 calling to the Web method. After running it, there is an error,

     

    "Unknown database error. Reason: There has been an overflow or underflow in GC memory pressure. The possible cause is unbalanced AddMemoryPressure and RemoveMemoryPressure calls.."

     

    How to solve it? I tried to restart computer or restart the application pool, seems these action could resolve it, But I want to know the reason and if there are other solution to solve.

    2008年5月16日 上午 09:26

解答

  • Hi,

     

        If the webservice u used is a third-part product and u just call its method simply, then perhaps it is the problem of

    this third-part product that it does not provide some good ways of dealing with the memory operation.

    2008年6月5日 上午 07:24

所有回覆

  •  

    Are you trying to create a new connection to sql server in the web method?

    and call the web method 3000 times???

     

    if so, please make a worker thread to handle the execution and implement a queue in your web method.

    or make your object to reusable but not create time by time.

     

    Jacky

     

    2008年5月18日 上午 09:24
  • Yes, I agree with Jacky that you can reuse the connection and apply singleton pattern in your system.

     

    Also, I'd like to suggest you to use the 'using' block for all DB related operations, so that all resources can be cleared up as soon as it can.

     

    Regards,

    Colt

     

    2008年5月19日 上午 09:32
  • The problem is.......

    The web service is a third party product, I could not be able to change its coding.

     

    Any other solution?

    2008年5月21日 上午 07:47
  • the webmethod input param is datatable or string value??

    why you have to call for 3000 times???

     

    can you format your value before submit?

    2008年5月21日 上午 11:54
  • >the webmethod input param is datatable or string value??

    Well, there are few param in the webMethod. One of them is a binary, while others are string.

     

    >Why I have to call 3000 times?
    Well, Hard to explain, it may be called more than 3000 times when in production. It is the business need.

     

    >can you format your value before submit?

    Already formatted as binary.

    2008年5月29日 上午 04:21
  • Hi,

     

        If the webservice u used is a third-part product and u just call its method simply, then perhaps it is the problem of

    this third-part product that it does not provide some good ways of dealing with the memory operation.

    2008年6月5日 上午 07:24
  •  

    Dear Jack Fu,

    So I have nothing to do in my side?

    2008年6月6日 上午 10:28
  • Ken, that's good news for you!!!

     

    2008年6月6日 上午 10:56
  • What good news for me? I don't understand.

     

    2008年6月10日 上午 02:37
  • Ken, I guess Jacky is saying a joke that the problem is caused by your component vendor, it's not your responsibility thus a good news for you..  (I believe you still need to solve this problem anyway..)

    2008年6月11日 上午 08:29