SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-21-2011, 08:13 AM
bradvido's Avatar
bradvido bradvido is offline
Sage User
 
Join Date: Nov 2010
Location: MN
Posts: 68
Exclamation Major Memory leak (Mapped File memory) during SageTV recordings

When SageTV (v7) records a file, it seems to map the file to memory. However, it never cleans up after itself and keeps consuming more and more memory. Using RAMMap (Sysinternals), I can see that SageTV consumed 4+GB of RAM while recording the news this morning. As soon as the news stopped recording, 4GB of RAM freed up on my server.

Has anyone else noticed this?

Refer to these screenshots:

RAMMap showing the Mapped File memory usage when recording the news.


When the recoding ended at 9:00 AM, the memory usage instantly cleared out:

Last edited by bradvido; 10-21-2011 at 08:16 AM.
Reply With Quote
  #2  
Old 10-21-2011, 12:42 PM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
I don't know how that can be happening because I only have 2 GB of RAM and make multiple recordings at the same time from 4 GB to 8 GB or more in size. Never saw this.

Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #3  
Old 10-21-2011, 12:44 PM
bradvido's Avatar
bradvido bradvido is offline
Sage User
 
Join Date: Nov 2010
Location: MN
Posts: 68
Maybe Sage is writing to memory (i have 8gb avail) instead of deleting an old recording from the disk and making space?

I don't know but it needs to be fixed
Reply With Quote
  #4  
Old 10-21-2011, 12:45 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I'm confused. You called it a leak and said it never gets cleaned up. But then you ended by saying it does give the memory back when the recording is finished. If that's true, then it's not a leak; it's just a large temporary memory demand.

I'm also not clear on whether the numbers you posted refer to actual physical memory in use, or just address space allocated. Mapping a 4GB file will take up 4GB of address space; that's what file mapping means. But it doesn't necessarily mean that all four GB will be swapped into physical memory at the same time.

Is there some performance issue you're trying to diagnose? Or did you just see these numbers and think something must be wrong?
__________________
-- Greg
Reply With Quote
  #5  
Old 10-21-2011, 12:50 PM
bradvido's Avatar
bradvido bradvido is offline
Sage User
 
Join Date: Nov 2010
Location: MN
Posts: 68
Quote:
Originally Posted by GKusnick View Post
I'm confused. You called it a leak and said it never gets cleaned up. But then you ended by saying it does give the memory back when the recording is finished. If that's true, then it's not a leak; it's just a large temporary memory demand.

I'm also not clear on whether the numbers you posted refer to actual physical memory in use, or just address space allocated. Mapping a 4GB file will take up 4GB of address space; that's what file mapping means. But it doesn't necessarily mean that all four GB will be swapped into physical memory at the same time.

Is there some performance issue you're trying to diagnose? Or did you just see these numbers and think something must be wrong?
Yes, it was a bit of a misnomer calling it a leak, more of just a hog, since it does get cleaned up when the recording is done.

Noticable, large performance issues are caused by this which leads me to believe that the memory space is reserved for Sage and not shared in anyway.

I'm just curious as to why Sage is allocating that much space? Is it some sort of buffer? Write recordings to disk and let the OS handle the buffer.
Reply With Quote
  #6  
Old 10-21-2011, 01:09 PM
paulbeers paulbeers is offline
SageTVaholic
 
Join Date: Jun 2005
Posts: 2,550
I am not sure this is true at all. Like gplasky, my server only has 4GB of physical memory and I record several recordings at once of 6+GB per recording. Based on what you are saying, I would need to have something like 25GB worth of memory! Now could Sage be dumping all the streams onto the hard drive which is being misconstrued as using virtual memory and then after the steam is completed and properly stored, the system no longer sees it as virtual memory but rather a file storage? This would make a lot more sense.

There is no way Sage could function on my server if the recordings were being stored in RAM. All of my clients would completely suffer....
__________________
Sage Server: AMD Athlon II 630, Asrock 785G motherboard, 3GB of RAM, 500GB OS HD in RAID 1 and 2 - 750GB Recording Drives, HDHomerun, Avermedia HD Duet & 2-HDPVRs, and 9.0TB storage in RAID 5 via Dell Perc 5i for DVD storage
Source: Clear QAM and OTA for locals, 2-DishNetwork VIP211's
Clients: 2 Sage HD300's, 2 Sage HD200's, 2 Sage HD100's, 1 MediaMVP, and 1 Placeshifter
Reply With Quote
  #7  
Old 10-21-2011, 01:09 PM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
I would think the Windows swap file would come into play here.

Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #8  
Old 10-21-2011, 01:10 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
I have never seen this and I only have 3 gigs of memory on my server and record at times 7 recordings simultaneously and still have plenty of memory left to do comskip and run videoredo.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
Reply With Quote
  #9  
Old 10-21-2011, 01:12 PM
bradvido's Avatar
bradvido bradvido is offline
Sage User
 
Join Date: Nov 2010
Location: MN
Posts: 68
Quote:
Originally Posted by paulbeers View Post
I am not sure this is true at all. Like gplasky, my server only has 4GB of physical memory and I record several recordings at once of 6+GB per recording. Based on what you are saying, I would need to have something like 25GB worth of memory! Now could Sage be dumping all the streams onto the hard drive which is being misconstrued as using virtual memory and then after the steam is completed and properly stored, the system no longer sees it as virtual memory but rather a file storage? This would make a lot more sense.

There is no way Sage could function on my server if the recordings were being stored in RAM. All of my clients would completely suffer....
I'm not saying Sage needs or requires physical RAM for each recording. I'm just saying it uses my memory because i have a lot to spare. I would like it to instead write to disk (like it does on your computer because it can't reserve that much memory).
Reply With Quote
  #10  
Old 10-21-2011, 01:48 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,312
Something else is at work here. Nobody else seems to have this issue. If you can grab a screen from process explorer so we can see what else is going on.
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA
Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60
Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u
Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup.
Reply With Quote
  #11  
Old 10-21-2011, 02:30 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
This is as mentioned, the memory mapping. It is not using that much physical memory, it's just the way the system writes the stream to disk. Sage can only use as much memory as the JVM can hold, which caps out around 1.2GB. Win7-64 can map up to 8TB of address space. This can be used for everything from actual RAM, paged storage, mapped file access, or device driver memory maps. Sage, rightly so, allocates the recording file as a mapped file, so all it has to worry about is writing to the mapped location, and the windows system deals with actually writing the bits to disc as it sees fit. (this is why process explorers and such will show the drive access as coming from System, and not from SageTVService).

See: http://en.wikipedia.org/wiki/Memory-mapped_file
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room

Last edited by Fuzzy; 10-21-2011 at 02:32 PM.
Reply With Quote
  #12  
Old 10-21-2011, 02:33 PM
bradvido's Avatar
bradvido bradvido is offline
Sage User
 
Join Date: Nov 2010
Location: MN
Posts: 68
Ok that makes sense. But what if another process wants to use that memor space? From what Ive seen, sage doesnt share
Reply With Quote
  #13  
Old 10-21-2011, 02:50 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Applications don't ask for specific memory addresses. Applications ask for a certain sized chunk of memory. Windows then tells it ok, you can have this range of address space. That doens't even mean that space is physical memory. Even if you only have 1GB or ram in your system, windows has 8TB of available address space it can use for user mode programs. Addresses are not necessarily places in RAM, they are an index to data. That data can point to physical memory, but it can also point to files, devices, whatever.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #14  
Old 10-21-2011, 05:52 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by gplasky View Post
I would think the Windows swap file would come into play here.
Not for mapped files. VM pages allocated to mapped files are backed by the files themselves. The page file comes into play only for pages that aren't backed by anything else (Java heap for instance).
__________________
-- Greg
Reply With Quote
  #15  
Old 11-22-2011, 12:49 PM
OldMariner OldMariner is offline
New Member
 
Join Date: Mar 2009
Posts: 3
same problem

Bradvido, SageTV is also hogging memory on my system, and this is a new problem. It eventually brings my W7-64bit system with 8GM RAM to it's knees, not due to CPU usage, but due to using all the RAM. SageTV gradually uses more and more memory while recording. When the recording is complete it releases this memory. But in the meantime, playback is slow to respond, and eventually nearly locks up when all available memory is used. Then all applications, such as the browser and Outlook also become slugs when the system has to go to virtual memory. Shutting down the other applications seems to have no effect as SageTV gobbles up that memory also.

It just started doing this. I am wondering if it is due to recent JAVA 64 bit version 6 update 29 that I installed. I have both the 32 bit and the 64 bit JAVA's. I will shut down the SageTV service and uninstall the 64 bit JAVA and see if that fixes the problem. Maybe I will also uninstall the 32 bit JAVA and reinstall it. This is one recent change that I can think of that might be doing this. I also recently installed the STV update; 2011110601. Sure hope that was not the cause.

Hope this info help to lead to a solution.

I will post further info as soon as I can.
Reply With Quote
  #16  
Old 11-22-2011, 02:41 PM
zoop's Avatar
zoop zoop is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Elkridge, MD
Posts: 184
several people in other threads are reporting issues with java 2.29... updating java should be looked upon as strictly optional, especially on a server that's reliant on it

/jer
__________________

AMD Ryzen 7 1700 w/ SageTV Server Linux V9.1.8.774 - Ubuntu 16.04LTS AMD64
-- 1x HDHomeRun Prime
-- 1x HDHR-DT
-- 1x HD-PVR
2x SageTV HD-300 Media Extenders
1x NVIDIA ShieldTV
Reply With Quote
  #17  
Old 11-22-2011, 03:52 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Also, installing 64-bit java should have no bearing on sagetv, as it is a 32-bit java program. It won't use the 64-bit JVM, no matter what you install.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #18  
Old 11-22-2011, 11:48 PM
davenlr davenlr is offline
Sage Advanced User
 
Join Date: Jun 2008
Posts: 149
I have 4gb of ram on a win7 64 bit server. Sage is the only service running (other than standard windows services). I disabled the swap file, and rebooted. Computer reported over half the physical memory free. After about 5 days of running, the computer stops with an out of memory error.

I have re-enabled the swap file, but thought it was interesting that it runs ok for 4 days, and then runs out of memory. Never ran any programs to see what was consuming it though. Its either windows or sage or Java.
__________________
Sage 7 on Win8.1 i7 6TB server, 1 gig network, HD Homerun
Reply With Quote
  #19  
Old 11-22-2011, 11:56 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Well, I can pretty much guarantee it isn't sage directly, as it can't use anything outside of the limits of the JVM (which will cap out at about 1.4GB max).
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #20  
Old 11-23-2011, 07:27 AM
briands briands is offline
Sage Icon
 
Join Date: Aug 2004
Location: Bloomington, IN
Posts: 1,093
My new Win7 x64 install is having a similar problem. The task manager also shows a process javaw.exe as growing. This is with Java 1_0_29.

I have not increased the heap on this system, so that is one of the next things to do along with researching the current "best" java version.
Reply With Quote
Reply

Tags
memory leak


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SageTV Service memory leak? valnar SageTV Software 8 03-23-2010 04:56 AM
SageTV Process Memory Leak? brandypuff SageTV Software 13 10-14-2008 05:14 PM
Memory Leak in SageTV Transcoder EdwardATeller SageTV Software 2 03-04-2008 11:47 AM
SageTV client memory leak? hocky98 SageTV Software 18 12-08-2006 01:32 AM
Runaway Memory Leak in SageTV Service morpheus SageTV Software 24 04-24-2006 12:40 PM


All times are GMT -6. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.