Bug 316346 - uses a lot of memory after prolonged use
Summary: uses a lot of memory after prolonged use
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kile
Classification: Applications
Component: general (show other bugs)
Version: 2.1.3
Platform: MacPorts macOS
: NOR normal
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-08 06:04 UTC by theufman
Modified: 2013-03-24 00:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sample LaTeX file with images (260 bytes, text/plain)
2013-03-24 00:24 UTC, theufman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description theufman 2013-03-08 06:04:20 UTC
After using Kile for an extended period of time, the computer begins running slower. After checking the Activity monitor for the laptop, it shows that Kile is requiring the use of 1.75GB of RAM to run. After searching, I am still not sure if this is a problem on my part or a memory issue.

Reproducible: Always

Steps to Reproduce:
1. Run the program, compile multiple times, use forward and reverse search with okular
2.
3.
Actual Results:  
After while, the computer runs slow and requires the program to be shut down and restarted to regain efficiency of the computer.

Expected Results:  
I would expect that I would not have to routinely restart the program to dispel a memory problem.
Comment 1 Michel Ludwig 2013-03-08 07:50:21 UTC
Sorry, but I think that you have to report this problem to the MacPorts community as I haven't encountered such a memory leak on Linux yet,
Comment 2 theufman 2013-03-23 20:57:48 UTC
(In reply to comment #1)
> Sorry, but I think that you have to report this problem to the MacPorts
> community as I haven't encountered such a memory leak on Linux yet,

Michael,

I first posted this downstream, but their response was that this was an upstream issue. I'm unsure how to proceed. Below is their response and ticket number:

--
https://trac.macports.org/ticket/38109

This is probably an upstream issue. You should report it to the Kile devs if you haven't already.
Comment 3 Michel Ludwig 2013-03-23 21:05:53 UTC
Well, I don't have access to Mac hardware at the moment, so you'll have to be my eyes and hands :)

Can you check if there is indeed a memory leak? How much memory does Kile use at the start?

Can you also try to find out if closing documents or so helps to release memory? And, can you check whether the same problems occur if you edit large documents in KWrite?
Comment 4 theufman 2013-03-23 21:24:36 UTC
When I start Kile, the program claims 69.3MB of real memory (as given by the Activity Monitor). I'm not sure how to check if there actually is a memory leak. Perhaps I used the term incorrectly? The program starts with a relatively minimal amount of space claimed for its use, and that number grows quite large as time progresses.

If I close Kile and reopen, the computer responds at its normal speed, and everything runs well for a while. After using Kile for a prolonged period of time, I notice the computer getting sluggish,  which prompts me to look at the Activity Monitor, which is when I noticed the large amount of RAM that the program was claiming.

I opened the same files in KWrite, and watched the Activity Monitor while editing, saving, etc. The starting amount of allocated RAM was about 64MB, and as I made edits, and saved, the memory usage stayed roughly the same; the amount went up as I worked, and after saving the document, the amount reduced a little. Granted, this was not nearly the same amount of time I spend in Kile, which can be hours at a time. 

I should say that my documents are between 1000 and 2000 lines, and each line is not very long (and a lot of lines are white space or commented text).

Let me know if there is any other information I can gather for you.
Comment 5 theufman 2013-03-23 21:39:16 UTC
Also, I notice that if I run pdftex, this increases the amount of real memory allocated to Kile by at least 5MB per compilation.
Comment 6 theufman 2013-03-23 21:45:46 UTC
Let me modify my previous statement. The compilation process does not add any memory to kile. If I have okular open as the embedded viewer after compilation (especially if there are graphics) then the space grows. When I close the viewer and return to Kile, memory usage drops but not to the original level before the viewer opening.
Comment 7 Michel Ludwig 2013-03-23 21:57:20 UTC
(In reply to comment #6)
> Let me modify my previous statement. The compilation process does not add
> any memory to kile. If I have okular open as the embedded viewer after
> compilation (especially if there are graphics) then the space grows. When I
> close the viewer and return to Kile, memory usage drops but not to the
> original level before the viewer opening.

Ok, this is interesting. Can you check what happens if you don't use the embedded viewer but an external Okular process?
Comment 8 theufman 2013-03-23 22:07:51 UTC
If I have the file come up in an external instance of okular, there is no appreciable increase in memory allocation. That activity of using the embedded viewer may be significant.
Comment 9 Michel Ludwig 2013-03-23 22:17:20 UTC
I think so too. Would it be possible to attach some LaTeX file with graphics which causes the memory leak on your machine? I could then verify whether this happens on Linux as well.
Comment 10 theufman 2013-03-24 00:24:30 UTC
Created attachment 78337 [details]
Sample LaTeX file with images

I'm attaching a sample latex file. When I open the file, the memory allocation jumps from 64 to 79MB. When I compile and view using the embedded viewer, the memory jumps to 125MB. If I compile and view the file 5 times, the memory usage goes up to 143MB, and the memory does not seem to be released when I return to the editor. Is it possible that there are multiple instances of okular running, and that is what is taxing the system?
Comment 11 theufman 2013-03-24 00:34:39 UTC
Furthermore, I notice that if I simply compile a file, there is no appreciable change in the memory usage. If I use ForwardPDF to view the document in the embedded viewer, again there is an increase which goes away as soon as I return to the editor. However, if I use the Quickbuild option (which for me uses pdflatex, then ForwardPDF), then I see the jump in memory usage which does not decline.