Intailly I will read the json string from the text file and change the Jason string to an object and add it to the list. Then I am calling the instagram feed API in the loop, after receiving the feedback, I am converting the response string into a Jason object and adding it to the list. Finally I am converting the list of objects to Jason String and writing it in a text file.
I need to update JSON string in two text files, so after completing all Instagram's requests, I am copying a text file from Jason String to another text file.
My problem
I am calling it the InstagramRecentList
method every 10 minutes to reflect Instagram, feed it on my web site I check memory usage in the server, then this application pool occupies more memory in one step. All apps hosted in IIS prevent this from speaking because of this. What is the best and effective way to do the process over, so that my application can not capture more memory
Screen shot with selected process that shows the memory usage of that application pool, now I am recycling app pool every day if I turn off recycling app pool, then use memory Increases. Please help me. excuse my English.
Public Performance InstagramRecentList () {string filepath = Path.Combine (ConfigurationManager.AppSettings ["instgramfilepath"], Constants.w_Instagram_recent_listJsonFile); String ClientID = Configuration Manager. AppSettings ["instgramclientid"]; String HondaID = Configuration Manager AppSettings ["instgramhondaid"]; WriteInstagramRecentList (File Path, Honda ID, ClientID); String wp = Path.Combine (Configuration Manager. AppSettings ["instgramfilepath"], Constants.r_Instagram_recent_listJsonFile); String Jsonstring = String.Empty; (Using the StreamReader sr = System.IO.File.OpenText (filepath)) {string s = String.Empty; While ((s = sr.ReadLine ()) = Null {Jsonstring = Jsonstring + s;}} TextWriter tw = New Streamer (WP); tw.WriteLine (Jsonstring); tw.Close (); tw.Dispose () ; Return View ("UpdateRilt");} Private Static Zero WriteInstagramRecentList (string file path, string HondaId, string client id, string nextpageurl = null) {string feedurl = string.Empty; List of & lt; Object & gt; Modeldata = New list By using the {string s}
After
WriteInstagramRecentList
method.
No comments:
Post a Comment