Version 2019 memory problem

Hi

I want to migrate from Xojo 2017 to 2019. When I test my app with the 2019 version, my RAM memory is double than with the 2017 build. Instead of 200 MB at start, I have immediately 500 MB. And then whatever I do, the memory increases like crazy.

Can you help?

Payam

Newer apps seem to be using memory like water.

If the memory increases then you have found a memory leak. You know what you have to do: try to reproduce the problem. Search Feedback to see if the problem is known. If not then make a new Feedback case.

interesting is when it happens, in which module or window or class.
ideas are hi dpi mode, 64 bit mode, objects are stored in global lists and are not released.
also possible a bug somewhere.

an empty project 2019r2 using 3-4 MByte in debug mode, 64 bit using less memory than 32 bit.

I am glad you raise the issue. I have the same problem with my app. Compiled with 2017R3, its memory usage is about 250 MB. Compiled with 2018R4, 2019R11, and 2019R2, its memory usage jumps to 1.2/1.5 GB. It happens when the main window is shown on the screen.

It only happens with macOS 64 built apps. Windows compiled app keeps its memory usage to 250 MB. I have started removing the plugins one by one to check if the problem linked to the Xojo Framework or a plugin.

I can see that it depends on the size of the window. If the window is large, memory usage is very high. If I reduce the size, memory decreases significantly.

Are you doing anything graphics intensive? Do you have many controls in the window? Are you using containers?

Do you know how to use Instruments? That’s the easiest way to identify memory leaks.

I have many controls in the window, and I also have containers.

I don’t know about Instruments.

I don’t think that I have memory leaks, because the memory does not increase gradually. It gets very high, when I make the window larger, and then the memory remains at the same level, until I do something else.

What I want to say is that previous to Xojo 2019 this problem did not exist at all. So the problem must be with the programming language rather than with my app.

Instruments:
https://forum.xojo.com/45314-xojo-instruments-diagnostic-tool-for-memory-leaks-and-circular-/0#p368018

Even if the problem is with Xojo and not with your app you still need to reproduce the problem. And if no masses are screaming “we got the same problem” then it’s likely something you are doing. And yes, this sucks.

Well, I sent a bug report and added my project to the report. The team can run the app on both versions 2017 and 2019, and see that there is something wrong either with my app or with Xojo. But I opened a report, because I thought it’s a problem on their side.

I have also noticed the disproportionate increase in memory when maximizing/enlarging windows under macOS for about 2 years and wondered that no one has ever reported about it. I also always blamed this on changes in the Xojo framework. Maybe it’s a memory leak and Xojo can look at the situation again?

What’s the feedback report number?

57995,
but it’s a private conversation.

Why? Is it because there is private code within it? If so, couldn’t you replicate the problem with a simple public one? The course of this conversation is of public interest. :frowning:

It’s because I enclosed my whole project.

What you can do:

  1. Create a new public Feedback. Explain what it is about.
  2. Use “Add Info” to attach your private project. For this “added info” you set the visibility to “only me & xojo”.
  3. Do the same for any further (public / private) information you’d like to add -> set visibility accordingly
    That way, the Feedback can be seen and found by everyone. But only Xojo gets access to the private Info with added private project.

When I removed the container controls from the window, memory usage decreased from 1.2GB to 430MB. Did you try to remove the container controls to see whether memory usage decreases or not ?

[quote=459792:@Payam Arzani]I have many controls in the window, and I also have containers.

I don’t know about Instruments.

I don’t think that I have memory leaks, because the memory does not increase gradually. It gets very high, when I make the window larger, and then the memory remains at the same level, until I do something else.

What I want to say is that previous to Xojo 2019 this problem did not exist at all. So the problem must be with the programming language rather than with my app.[/quote]

Container Controls seems problematic, and memory auto release in other cases seems problematic too.

feedback://showreport?report_id=41624
feedback://showreport?report_id=47818
feedback://showreport?report_id=45697
feedback://showreport?report_id=40082

Even Xojo seems affected:

feedback://showreport?report_id=27264

I have been observing this behavior for quite some time and am dependent on the use of ContainerControls. Hopefully Xojo will slowly take on the feedback cases mentioned by Rick.

I also removed one container control from my window, but that didn’t change anything. Maybe all container controls must be removed, but that is something I can’t do, because I have too much code referring to those controls.