Jump to content

Organisation of process memory


photo

Recommended Posts

Hello, I have a series of questions.
My programm has some modules. For example, an editor (look like Unigine Editor) and a player of mission. When we load world for a mission, I have got a peak of memory for 1-2 secons (is it cashing?) and when I close world and cleaning memory (if variables were dynamic and they weren't nodes of Editor), some part of memory remain. It isn't look like of classic memory leak, because then i load previous world, i haven't got a peak of memory and values of memory in first and second loading are similar.
How i can extend a load screen until end of peak of memory? How i can clear this cash? I need in this, becuase projects use various modules with a lot of worlds. I can do this with using Console::get()->run("video_restart"), but it is not a good solution for me.

1.png

2.png

3.png

Link to comment

Hello Alexey,

If I got everything right, the main problem is the memory leak that happens after each world load. This happens both in Editor and the Engine. Right?

On 4/2/2019 at 4:59 PM, tolchinski.alexei said:

How i can extend a load screen until end of peak of memory?

You can manage the load screen and progress bar with getNumLoadedResources(). In this thread, you can find some useful info: https://developer.unigine.com/forum/topic/4646-delay-loading-screen-while-streaming-in-data/?do=findComment&comment=24388

 

 

On 4/2/2019 at 4:59 PM, tolchinski.alexei said:

How i can clear this cash?

Can't give you an answer right now, need some time to check your case.

Thanks.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hello.
As I wrote earlier, values of memory when the some world load in first and another loadings are simple. When i unloaded the world at first, process memory has been increased. But in the following unloadings world, process memory is constant.
Thanks, i will try to use  
getNumLoadedResources() and i will wait an answer to the second part of question.

Link to comment

Hello Alexey,

I did some test on memory consumption. How I tested:

  • added our "heavy" worlds in on project
  • loaded each one multiple times and wrote down memory consumption

What I can confirm:

Yes, there's a RAM consumption spike when you load the world. This is happening because part of the resources is being transferred from the disk to the VRAM. RAM here plays the role of a buffer. Some data can be managed by Windows, I guess you can dig a little bit deeper with RAMmap tool.

What I haven't observed:

Memory leaks or inadequate RAM consumption.

As I understood, your concern is about possible RAM drain during continuous application work. Have you already encountered this issue? If so, we'd like to get a test sample.

From my point of view, there's nothing to be bothered about.

Thanks.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hello.
Sorry for waiting, i was working on another task and i tried to check this problem with memory. It isn't classical memory leaks. Maybe my programm save cache after unload world. It is not a lot for one world, but programm will have got 5-20 worlds and i don't save this cache after unload, because programm must work continuous and i have got some modules, which will be work without worlds or with another worlds.
Console::get()->run("video_restart") is not the best solution for me, because i don't need in video restart, but it help me. How i can simulate it without video restart? I can't give test sample at now, because program is commercial secrecy.

Link to comment

Alexey, I'm sorry, but I still don't get the problem.

The engine is managing resources, works with RAM, VRAM and cache files. Do you encounter crashes or performance issues? Why do you want to manage memory manually?

Right now it sounds that you're sharing some observed behavior that doesn't result in any particular issue.

Maybe I misunderstood you?

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

No, I haven't got any crashes or problem with perfomance. But in the future, then programm will be almost ready, there is a small chance that afrer loadings a lot of worlds, programm will have got not enough memory for another. Are my worries not justified? Or engine will clean cache files, if programm will have got little RAM during long work.
Excuse me for troubling, i just want to be sure about stability.

Link to comment

As I mentioned before, during my tests (I was loading a number of our demos) RAM didn't exceed. I checked on 8Gb and 16Gb RAM configs. If you're planning to work with a huge amount of data, it worth considering 32Gb or even more for the system.

However, your observation is a good practice. If you'll run into a problem in the future - contact us and we'll help.

Thank you.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...