1. Smart City doo
  2. Valentina Server
  3. Donnerstag, Januar 23 2020, 04:19 PM
  4.  Abonnieren via E-Mail
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
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Please check, that cursors are destroyed. Judging on the vServer logs you sent me recently - there are tons of cursors - living but not used.
Kommentar
There are no comments made yet.
Smart City doo Akzeptierte Antwort
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
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Smart City doo Akzeptierte Antwort
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?
Kommentar
There are no comments made yet.
Smart City doo Akzeptierte Antwort
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
Kommentar
Do you mean admin's command "drop connections"? yes, it should clean up.
  1. Ruslan Zasukhin
  2. vor etwa 8 Monaten
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Smart City doo Akzeptierte Antwort
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.
Kommentar
There are no comments made yet.
Smart City doo Akzeptierte Antwort
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?
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
I will try to reproduce it first - send me the vServer log please
Kommentar
There are no comments made yet.
Smart City doo Akzeptierte Antwort
I will try to reproduce it first - send me the vServer log please
Logs...
Anhänge
Kommentar
There are no comments made yet.
Smart City doo Akzeptierte Antwort
I will try to reproduce it first - send me the vServer log please
Any news? ;)
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
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"?
Kommentar
There are no comments made yet.
  • Seite :
  • 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