1. Smart City doo
  2. Valentina Server
  3. Thursday, January 23 2020, 04:19 PM
  4.  Subscribe via email
I've had a situation where vServer used 95% of RAM and all connections were slow.

Is there any way to release memory?

Restart solved the problem but it is not regular.

regards,
Zoran
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
Please check, that cursors are destroyed. Judging on the vServer logs you sent me recently - there are tons of cursors - living but not used.
Comment
There are no comments made yet.
Smart City doo Accepted Answer
Please check, that cursors are destroyed. Judging on the vServer logs you sent me recently - there are tons of cursors - living but not used.

I am sure you are right, but in cursor count column, there is only 1-3 cursors active by connection (20-30 connections)
Can I destroy all cursors periodicaly by sendind some command to clean database while I found my vCursors not destroyed in code?

regards
Comment
There are no comments made yet.
Ruslan Zasukhin Accepted Answer
Hi,

A Cursor can be destroyed only by who have created it.

Cursor not always means a lot of RAM. It depends on query. Some cursors can select only 1 record, other can select a lot of records.

Good advice is - use a query that selects a small number of records.
Comment
There are no comments made yet.
Smart City doo Accepted Answer
Hi,

A Cursor can be destroyed only by who have created it.

Cursor not always means a lot of RAM. It depends on query. Some cursors can select only 1 record, other can select a lot of records.

Good advice is - use a query that selects a small number of records.


Lets consider next scenario:

Client connected to vServer crashes with some cursor loaded.
Can I destroy this cursor on next App init?

Meybe I can restart vServer periodicaly to clean all unused cursors?
Comment
There are no comments made yet.
Smart City doo Accepted Answer
Hi,

A Cursor can be destroyed only by who have created it.

Cursor not always means a lot of RAM. It depends on query. Some cursors can select only 1 record, other can select a lot of records.

Good advice is - use a query that selects a small number of records.


Another question.
If I make nightly connections kill on vServer, will I clean cursors?

regards
Comment
Do you mean admin's command "drop connections"? yes, it should clean up.
  1. Ruslan Zasukhin
  2. 3 weeks ago
There are no comments made yet.
Ivan Smahin Accepted Answer
Connections crashes should be ok - it is just "unexpected connection termination" for vServer.
Cursors are destroyed either by calling vCursor's destructor on particular connection side or by closing vClient database/connection.
All scenarios above lead to closing vServer-side cursors.
Also, vServer may decide to disconnect some client (idle timeout for example). In this case its cursors will be destroyed as well.

I guess you have some long-running connections which are not destroying own cursors. There are no external way to destroy such cursors except killing such connections.
But better check your client-side workflow - obviously there are dangling objects and memory leaks.
Comment
There are no comments made yet.
Smart City doo Accepted Answer
Connections crashes should be ok - it is just "unexpected connection termination" for vServer.
Cursors are destroyed either by calling vCursor's destructor on particular connection side or by closing vClient database/connection.
All scenarios above lead to closing vServer-side cursors.
Also, vServer may decide to disconnect some client (idle timeout for example). In this case its cursors will be destroyed as well.

I guess you have some long-running connections which are not destroying own cursors. There are no external way to destroy such cursors except killing such connections.
But better check your client-side workflow - obviously there are dangling objects and memory leaks.

Thank you.
This helps.
Comment
There are no comments made yet.
Smart City doo Accepted Answer
Connections crashes should be ok - it is just "unexpected connection termination" for vServer.
Cursors are destroyed either by calling vCursor's destructor on particular connection side or by closing vClient database/connection.
All scenarios above lead to closing vServer-side cursors.
Also, vServer may decide to disconnect some client (idle timeout for example). In this case its cursors will be destroyed as well.

I guess you have some long-running connections which are not destroying own cursors. There are no external way to destroy such cursors except killing such connections.
But better check your client-side workflow - obviously there are dangling objects and memory leaks.


I tried
DROP CONNECTIONS OF DATABASE mydatabase
from vStudio but my vServer hangs?!

Bookmark entry in vStudio is grey - not green or red.

I have to kill process from task manager to get vServer start again.

Where am I going wrong?
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
I will try to reproduce it first - send me the vServer log please
Comment
There are no comments made yet.
Smart City doo Accepted Answer
I will try to reproduce it first - send me the vServer log please
Logs...
Attachments (1)
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.