i working server api developed third-party supplier. api came in form of .jar file, since wanted use inside of asp.net mvc application, converted dll using ikvm. solution works part.
however, 1 day received complaints our user community our application running on 1 of our servers. checked , discovered w3wp.exe worker process running our iis application pool running @ 99% cpu usage (usually it's less 10%). attached instance of dottrace w3wp.exe , discovered "hotspots" traced java input stream read methods being called server api:
java.io.bufferedinputstream.getbufifopen java.io.bufferedinputstream.fill java.io.bufferedinputstream.read(byte[], int32, int32) java.net.socketinputstream.read(byte[], int32, int32) java.io.bufferedinputstream.read1(byte[], int32, int32)
looking further @ our own source code, believe have discovered offending line on our side:
messagedatabytes = dataconnector.getinputstream().read();
this line seems innocent enough. why run cpu 99%? , how can safely call these methods our application , prevent misbehavior in these methods negatively impacting entire application?
my initial thought call these methods separate thread can kill if doesn't finish after length of time. on right track?
any thoughts , suggestions appreciated.
Comments
Post a Comment