Jump to content

Problem with Memory in Server


cristianotestai

Recommended Posts

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.

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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? :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...