cristianotestai Posted July 5, 2011 Share Posted July 5, 2011 Hi Farshad, I believe have a serious problem in my app about memory not released by server. If i open several sessions, i have noticed increased memory in the server process, which is normal, but at the end of the session, low memory is released, causing memory always be high. I fixed some problems with "Memory Leak", but for moment, my objects is ok. For example, when the first session starts, the memory is about 3.5 mgb, and for each new session is increased approximately 600kb. When the sessions are closed very few kb are released. I did tests with SessionTimeout = 1 minute and open several sessions by pressing F5 on Browser, and analyzed the memory of the server in task manager control. Any ideas or any possible problem of not releasing the memory UniGuiServer? Tks for help. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 6, 2011 Administrators Share Posted July 6, 2011 Task Manager doesn't show the actual memory usage after sessions are released. Windows doesn't immediately release the memory pool reserved for your app. For your case after creating 100 sessions task manager will show 60 MB memory usage. Now terminate all sessions. Task manager still shows 60 MB usage. Now if you recreate another 100 sessions memory usage will not increase because same memory pool is used again. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 6, 2011 Administrators Share Posted July 6, 2011 http://delphi.about.com/od/delphitips2007/qt/memory_usage.htm Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted July 6, 2011 Author Share Posted July 6, 2011 Task Manager doesn't show the actual memory usage after sessions are released. Windows doesn't immediately release the memory pool reserved for your app. For your case after creating 100 sessions task manager will show 60 MB memory usage. Now terminate all sessions. Task manager still shows 60 MB usage. Now if you recreate another 100 sessions memory usage will not increase because same memory pool is used again. Farshad, You're right, I saw in new tests, generating new sessions. Tks for explanation. I have two important questions: 1) Is there a way to prevent the user from constantly pressing F5? If the user is constantly pressing F5, it creates a lot of sessions and the server can crash and fall. I did some testing with my application and also with the programs Demo UniGui and this scenario occurs, causing server crashes and unnecessary increase in memory. 2) In sites like gmail, for example, if my session is to open the inbox, or writing a message and I press F5, it does not create a new session apparently just does reload the page and remains on the screen previously. Currently, if I'm in a session and press F5, it creates a new session. Is there any way possible to do as the above example? Tks again and congratulations for excelent work. Quote Link to comment Share on other sites More sharing options...
acesar Posted July 6, 2011 Share Posted July 6, 2011 Oi, Cristiano, creio que pelo nome seja brasileiro também... Já tentou algum JavaScript? In English: Hi, Cristiano, I think you are brazilian... Have you tried some JavaScript like: "to disable F5 and back button add following code <script> window.history.forward(1); document.attachEvent("onkeydown", my_onkeydown_handler); function my_onkeydown_handler() { switch (event.keyCode) { case 116 : // 'F5' event.returnValue = false; event.keyCode = 0; window.status = "We have disabled F5"; break; } } </script>" (http://www.ozzu.com/programming-forum/disable-key-and-back-t44867.html) (http://www.webdeveloper.com/forum/showthread.php?t=62177) (http://www.webmasterworld.com/forum91/4388.htm) Quote Link to comment Share on other sites More sharing options...
cristianotestai Posted July 6, 2011 Author Share Posted July 6, 2011 Oi, Cristiano, creio que pelo nome seja brasileiro também... Já tentou algum JavaScript? Hello! I am Brazilian too! Tks for the tip, but I would like a more elegant solution, for example, that the server understands the user session is already open and cancels the request ... something in this sense, or another appropriate solution. Best Regards. Quote Link to comment Share on other sites More sharing options...
thecrgrt Posted July 7, 2011 Share Posted July 7, 2011 Hello! I am Brazilian too! Tks for the tip, but I would like a more elegant solution, for example, that the server understands the user session is already open and cancels the request ... something in this sense, or another appropriate solution. Best Regards. http://code.google.com/p/extpascal/wiki/FAQ I've found the some resource for ExtPascal for the feature that your requested, but I don't know how do UniGUI is implemented it? maybe you should try it in this way, or maybe Fashad can tell us, how can we do? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 7, 2011 Administrators Share Posted July 7, 2011 The best solution is to prevent any single IP from owning more than one session at a time. Already logged as #1003 Same thing can be done by tracking cookies. Quote Link to comment Share on other sites More sharing options...
thecrgrt Posted July 8, 2011 Share Posted July 8, 2011 The best solution is to prevent any single IP from owning more than one session at a time. Already logged as #1003 Same thing can be done by tracking cookies. how do you think about "Manipulation of current context" of Raudus? http://samples.raudus.com:88/99-Context-Redmond Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 8, 2011 Administrators Share Posted July 8, 2011 how do you think about "Manipulation of current context" of Raudus? http://samples.raudu...Context-Redmond Can you explain a bit more about it? Quote Link to comment Share on other sites More sharing options...
thecrgrt Posted July 8, 2011 Share Posted July 8, 2011 Can you explain a bit more about it? The example was implemented the session contexts were kept together with the same users id. that have been logged-in, and restore its session with the last changed session when logged-in with those users id. In short, it was snap-shot session for logged-in users and were restored for them at next logged-in. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.