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
No news for now. But probably things go better with a new release (v.10.0.2).

Did you check that "dangled" cursors in your app? Anyway, it seems that your app do something like this one:
Open connection, do some queries (probably in the loop), and forget to destroy cursors.
So, if the connection lives long enough, you will get some "dangled" cursors in each connection, but vServer has no idea that they are not used anymore and can do nothing to destroy them.

You may try following - download the latest vServer release and using vStudio's "Tools/Server Admin" - disconnect all the clients (except yours) and see - does vServer's memory get back to the "normal"?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 1
Smart City doo Accepted Answer
I will try to reproduce it first - send me the vServer log please
Any news? ;)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 2
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.
  1. more than a month ago
  2. Valentina Server
  3. # 3
Ivan Smahin Accepted Answer
I will try to reproduce it first - send me the vServer log please
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 4
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.
  1. more than a month ago
  2. Valentina Server
  3. # 5
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.
  1. more than a month ago
  2. Valentina Server
  3. # 6
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.
  1. more than a month ago
  2. Valentina Server
  3. # 7
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. 2 months ago
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 8
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.
  1. more than a month ago
  2. Valentina Server
  3. # 9
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.
  1. more than a month ago
  2. Valentina Server
  3. # 10
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.
  1. more than a month ago
  2. Valentina Server
  3. # 11
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.
  1. more than a month ago
  2. Valentina Server
  3. # 12
  • Page :
  • 1


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

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories