I have done a good amount of research on this "problem". My site does not use recursion except for later in the program but the part I'm debugging has not gotten to that yet so that cannot be the issue. Visual studio does not like this page of mine. In order to debug the page, I have to usually first debug another page before it by viewing the values of a few variables. If I try to start debugging the page without first debugging another page, a box will popup in visual studio. I have pasted this image also. It's the 2nd image showing the same large negative integer value. There are about 100 calls throughout the code to this function below. Can a stackoverflow occur just because these are alot of calls to the same function ?
Protected Function Calcpmtafterio(ByVal maxbal As Decimal, ByVal npmts As Int16, ByVal starttype As Int16, ByVal startrate As Decimal, ByVal startper As Int16, ByVal pmtcap As Decimal, ByVal pmtper As Int16, ByVal orate As Decimal, ByVal nrate As Decimal, ByVal obal As Decimal, ByVal tpmts As Int16, ByVal io As Int16, ByVal iocb As Boolean, ByVal miamt As Decimal) As Decimal
Payment = Calcpmtafterio(maxbalance, numpmts, pmtinit, pmtadj1, pmtadj1mo1, pmtadjcap, pmtadjper, Origrate, Noterate, Origbal, TotPmts, Io, cbioinitialperiod.Checked, miamt)
I think it is blowing up because of the size of the page. The page has about 16800 lines of code. It has been working fine for me until I added more code blocks. My code is an amortization calculator and there are 9 rows and each row has identical code blocks. One computes the payments and the other section is the looping section which determines when to exit the loop and start a new row with a new payment.
I have watched a video showing the diagnostic tools which has a memory usage tab and shows the heap size and the Call Stack. I don't see any information about what is causing the error. When I drill down into the error underlined in green in my vs, there is a negative number which is quite large probably too large for an integer. What can cause this to happen in visual studio?