Closed picope closed 10 months ago
unfortunately, i can't recreate it on my machine and would need a little more information.
What exactly does your dynamic library do in the constructor. Does it start any threads or processes? Or does it initialize anything that does that? As I understand it, it is a library you created, right? Can you create the library documentation on the console using the libdoc tool from RobotFramework?
I see you have an old RobotFramework version, now current is version 6.1, have you tried a newer RobotFramework version?
RobotCode starts internally several subprocesses, so for example every time a library has to be parsed, because Python is not so good at threading and on the other hand because a library has to be instantiated and you don't know what else the library instantiates. For the library documentation it is not necessary that everything is initialized in the constructor, but only what is needed to query the keywords.
from typing import Dict, Optional
from robot.running.context import EXECUTION_CONTEXTS
class DummyLibrary:
def __init__(self, device_config: Optional[Dict[str, str]] = None) -> None:
do_a_little_bit()
if EXECUTION_CONTEXTS.current is not None: # check if robot is running
do_what_ever_is_needed_to_execute_keywords()
def get_keywords(self):
...
....
The above code is an example of initializing a library correctly only when RobotFramework is running. So not when LibDoc is running, which RobotCode does in the background when it encounters a library import in the background. Maybe you can try this?
There is at least one second entry in the output view that starts with RobotCode Language Server, can you take a look at it or copy the output here?
If there is nothing, you can also increase the loglevel, just open the .vscode/settings.json
(if it does not exist yet, please execute the command "Preferences: Open Workspace Settings (JSON)") and insert the following code:
"robotcode.languageServer.extraArgs": [
"--log",
"--log-level",
"DEBUG", // DEBUG, INFO, WARN, ERROR, CRITICAL
]
And then look again in the Output View.
any news about this?
@picope do you have some more informations about this issue? If I don't hear from you again, I will unfortunately have to close this issue.
Hi! Sorry for the delay @d-biehl , i was kinda busy last days.
Answering your questions, the constructor of this library does not create any threads or processes. I can run libdoc on the library and makes the doc just fine. By now we are forced to use RF4 due to project requirements, and we are not upgrading any soon. As you suggest ill try increasing log level, and reply this issue as soon as possible.
@picope do you have any news about this issue?
@picope ping
closed due to inactivity
Description
Noticed high CPU and memory usage when editing a project that uses a dynamic library. Trying out older versions of the extension, i noticed:
❌ version 0.51.1 and newer heve the issue. ✅ version 0.50.0 and older work as expected.
Steps to reproduce
Code snippet
I'm not allowed to share the code, but this is more or less how the import statement of the dynamic library looks like:
Screenshots
Expected behavior
As in version 0.50.0 , i expect the processes to consume at most 200MB of memory .
Logs
Desktop