Jump to content

Out of Memory exception


Angelblue05

Recommended Posts

I don't think it makes any sense for the server to impose an arbitrary limit because there are too many factors involved and no way to know what the limit should be.

 

Again, I don't think a pre-load like that is a great design in a disconnected app like this but, if it is crucial to your app then it should be pretty easy to put the request in a simple loop that grabs them 500 at a time.  That should be no problem on 99% of systems.

Link to comment
Share on other sites

BTW - something that could have compounded this last test run, was that the user attempted to bring up the log in the dashboard and that also caused an OOM.  And, once you've hit that once, other things tend to fail as well.

Link to comment
Share on other sites

xnappo

Doesn't really have anything to do with the pre-load.  In just the normal app - the 'All Movies' entry does this query and has been for 1.2 years without anyone having memory problems.

 

So - I suspect there is something else going on, regardless of whether it is a good idea.  

Link to comment
Share on other sites

saitoh183

We have been doing that since day 1, and people with bigger collections than this have been running for a long time.  If large queries are going to fail, the server should have a limit itself.  800 movies is nothing compared to some of our users.

 

I will try to break it up, but I suspect it will still happen.

 

@ / @@im85288 FYI

 

@@Angelblue05 - when this happens:

   1. Are you still able to browse 'All Movies' normally?

   2. In task manager, how much memory is MediaBrowser Server taking when this error occurs?

 

xnappo

 

When the error occurs often it is during playback, but once i stop watching and go to browse...i can still see everything just fine. As for memory usages...i would have to check. I will turn back on artwork rotation so i can force the error to happen.

Link to comment
Share on other sites

saitoh183

Is the server the same as the playback machine?  Are you possibly... Running out of memory?

 

 

Server is a W2012 R2 with 12GB of ram. it is a not my HTPC

 

Highest usage i have gotten ever on the machine (with Hyper-V running a VM) is 7.9GB

Link to comment
Share on other sites

xnappo

Please check the memory usage of MB server when it is producing these errors.  In the other thread you said 'catalyst control center was eating up memory' - so you ARE running low?

Link to comment
Share on other sites

xnappo

Are you running Titan or XF1080?  I notice a ton of queries to collections - so I think you must be.

 

Now that I look at more than the error - your server is being absolutely hammered by requests.

Edited by xnappo
Link to comment
Share on other sites

saitoh183

Are you running Titan or XF1080?  I notice a ton of queries to collections - so I think you must be.

 

Now that I look at more than the error - your server is being absolutely hammered by requests.

 

Titan

 

going to lunch will start back after i get back

Link to comment
Share on other sites

xnappo

Okay, I think the skin helper service thing is updating the collections too agressively.

 

@@marcelveldt

@@im85288

@

 

Definitely we need to shut the services down during playback.  We also need to update them less often.  I am concerned we have like 12 threads going in parallel all hammering the server.

Link to comment
Share on other sites

im85288

I have just merged the skin helper into the main code, let's discuss this further in the dev section as I made some other changes too.

Link to comment
Share on other sites

saitoh183

Are you running Titan or XF1080?  I notice a ton of queries to collections - so I think you must be.

 

Now that I look at more than the error - your server is being absolutely hammered by requests.

 

 

Ok,

 

I restarted my MBS (it actually crashed the application with a pop up windows Out of Memory),debug enabled. Waited for all the scans to finished then restarted Kodi/titan Helix. While Kodi was loading menus and such, MBS CPU hovered in the 40% to 60% range and RAM usages was around 650mb. When the Error(Error + Json) happened, CPU dropped to 0 to 2% and RAM spiked to 799MB and stuck there for a bit. Leaving the error on screen, the Ram climbed to 821MB but dropped back down to 700+MB and 700 seems to be the average RAM usage.

 

http://xbmclogs.com/show.php?id=368586

Link to comment
Share on other sites

xnappo

@@ebr - in his latest log this happened with a limit=30 request (from PM)

2014-12-09 14:12:24.9344 Debug - HttpServer: HTTP GET http://192.168.13.198:8096/mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Limit=30&Recursive=true&SortBy=DateCreated&Fields=Path,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary&SortOrder=Descending&Filters=IsUnplayed,IsNotFolder&IncludeItemTypes=Movie&format=json
	Ip: 192.168.13.101:44800. Headers: X-MediaBrowser-Token=7381e220b9134edeaac03b6f44b6c5d6,Accept-Charset=UTF-8,*,Accept-Encoding=gzip,Authorization=MediaBrowser UserId="f6c51e6fd330e59d16f4cc52886702e1",Client="XBMC",Device="Downstairs",DeviceId="5A6AC675126645FDB06493CC4BB1BFE6",Version="0.9.732",Host=192.168.13.198:8096
2014-12-09 14:12:25.1854 Error - DtoUtils: ServiceBase<TRequest>::Service Exception
	Exception of type 'System.OutOfMemoryException' was thrown.
	System.OutOfMemoryException
	   at System.Text.StringBuilder.set_Length(Int32 value)
	   at ServiceStack.Text.JsonSerializer.StringBuilderWriter.Create()
	   at ServiceStack.Text.JsonSerializer.SerializeToString(Object value, Type type)
	   at ServiceStack.Text.JsonSerializer.SerializeToString[T](T value)
	   at ServiceStack.Serialization.JsonDataContractSerializer.SerializeToString[T](T obj)
	   at ServiceStack.Host.ContentTypes.SerializeToString(IRequest req, Object response)
	   at ServiceStack.RequestExtensions.ToOptimizedResult[T](IRequest request, T dto)
	   at MediaBrowser.Server.Implementations.HttpServer.HttpResultFactory.GetOptimizedResult[T](IRequest requestContext, T result, IDictionary`2 responseHeaders)
	   at MediaBrowser.Api.BaseApiService.ToOptimizedResult[T](T result)
	   at MediaBrowser.Api.UserLibrary.ItemsService.<Get>d__0.MoveNext()
	
2014-12-09 14:12:25.1854 Error - HttpServer: Error processing request for /mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Limit=30&Recursive=true&SortBy=DateCreated&Fields=Path,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary&SortOrder=Descending&Filters=IsUnplayed,IsNotFolder&IncludeItemTypes=Movie&format=json
	Exception of type 'System.OutOfMemoryException' was thrown.
	ServiceStack.HttpError
	No Stack Trace Available
	
2014-12-09 14:12:25.1854 Debug - HttpServer: HTTP Response 500 to 192.168.13.101. Response time: 251.0139 ms.
	Url: http://192.168.13.198:8096/mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Limit=30&Recursive=true&SortBy=DateCreated&Fields=Path,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary&SortOrder=Descending&Filters=IsUnplayed,IsNotFolder&IncludeItemTypes=Movie&format=json
Link to comment
Share on other sites

saitoh183

I think the Titan 'skin helper' may also be grabbing episodes recursively.

@@marcelveldt

 

 

think so also?

Edited by saitoh183
Link to comment
Share on other sites

saitoh183

 

@@ebr - in his latest log this happened with a limit=30 request (from PM)

2014-12-09 14:12:24.9344 Debug - HttpServer: HTTP GET http://192.168.13.198:8096/mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Limit=30&Recursive=true&SortBy=DateCreated&Fields=Path,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary&SortOrder=Descending&Filters=IsUnplayed,IsNotFolder&IncludeItemTypes=Movie&format=json
	Ip: 192.168.13.101:44800. Headers: X-MediaBrowser-Token=7381e220b9134edeaac03b6f44b6c5d6,Accept-Charset=UTF-8,*,Accept-Encoding=gzip,Authorization=MediaBrowser UserId="f6c51e6fd330e59d16f4cc52886702e1",Client="XBMC",Device="Downstairs",DeviceId="5A6AC675126645FDB06493CC4BB1BFE6",Version="0.9.732",Host=192.168.13.198:8096
2014-12-09 14:12:25.1854 Error - DtoUtils: ServiceBase<TRequest>::Service Exception
	Exception of type 'System.OutOfMemoryException' was thrown.
	System.OutOfMemoryException
	   at System.Text.StringBuilder.set_Length(Int32 value)
	   at ServiceStack.Text.JsonSerializer.StringBuilderWriter.Create()
	   at ServiceStack.Text.JsonSerializer.SerializeToString(Object value, Type type)
	   at ServiceStack.Text.JsonSerializer.SerializeToString[T](T value)
	   at ServiceStack.Serialization.JsonDataContractSerializer.SerializeToString[T](T obj)
	   at ServiceStack.Host.ContentTypes.SerializeToString(IRequest req, Object response)
	   at ServiceStack.RequestExtensions.ToOptimizedResult[T](IRequest request, T dto)
	   at MediaBrowser.Server.Implementations.HttpServer.HttpResultFactory.GetOptimizedResult[T](IRequest requestContext, T result, IDictionary`2 responseHeaders)
	   at MediaBrowser.Api.BaseApiService.ToOptimizedResult[T](T result)
	   at MediaBrowser.Api.UserLibrary.ItemsService.<Get>d__0.MoveNext()
	
2014-12-09 14:12:25.1854 Error - HttpServer: Error processing request for /mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Limit=30&Recursive=true&SortBy=DateCreated&Fields=Path,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary&SortOrder=Descending&Filters=IsUnplayed,IsNotFolder&IncludeItemTypes=Movie&format=json
	Exception of type 'System.OutOfMemoryException' was thrown.
	ServiceStack.HttpError
	No Stack Trace Available
	
2014-12-09 14:12:25.1854 Debug - HttpServer: HTTP Response 500 to 192.168.13.101. Response time: 251.0139 ms.
	Url: http://192.168.13.198:8096/mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Limit=30&Recursive=true&SortBy=DateCreated&Fields=Path,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary&SortOrder=Descending&Filters=IsUnplayed,IsNotFolder&IncludeItemTypes=Movie&format=json

 

This error followed right after the one above

2014-12-09 14:13:02.8447 Debug - HttpServer: HTTP GET http://192.168.13.198:8096/mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Recursive=true&SortBy=SortName&Fields=Path,People,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary,EpisodeCount,SeasonCount,Studios,CumulativeRunTimeTicks,Metascore,SeriesStudio&SortOrder=Ascending&Filters=IsNotFolder&ExcludeLocationTypes=Virtual&IncludeItemTypes=Movie&format=json
	Ip: 192.168.13.101:44951. Headers: X-MediaBrowser-Token=7381e220b9134edeaac03b6f44b6c5d6,Accept-Charset=UTF-8,*,Accept-Encoding=gzip,Authorization=MediaBrowser UserId="f6c51e6fd330e59d16f4cc52886702e1",Client="XBMC",Device="Downstairs",DeviceId="5A6AC675126645FDB06493CC4BB1BFE6",Version="0.9.732",Host=192.168.13.198:8096
2014-12-09 14:13:06.2809 Error - DtoUtils: ServiceBase<TRequest>::Service Exception
	Exception of type 'System.OutOfMemoryException' was thrown.
	System.OutOfMemoryException
	   at System.Text.StringBuilder.ToString()
	   at ServiceStack.Text.JsonSerializer.StringBuilderWriter.ToString()
	   at ServiceStack.Text.JsonSerializer.SerializeToString(Object value, Type type)
	   at ServiceStack.Text.JsonSerializer.SerializeToString[T](T value)
	   at ServiceStack.Serialization.JsonDataContractSerializer.SerializeToString[T](T obj)
	   at ServiceStack.Host.ContentTypes.SerializeToString(IRequest req, Object response)
	   at ServiceStack.RequestExtensions.ToOptimizedResult[T](IRequest request, T dto)
	   at MediaBrowser.Server.Implementations.HttpServer.HttpResultFactory.GetOptimizedResult[T](IRequest requestContext, T result, IDictionary`2 responseHeaders)
	   at MediaBrowser.Api.BaseApiService.ToOptimizedResult[T](T result)
	   at MediaBrowser.Api.UserLibrary.ItemsService.<Get>d__0.MoveNext()
	
2014-12-09 14:13:06.2809 Error - HttpServer: Error processing request for /mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Recursive=true&SortBy=SortName&Fields=Path,People,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary,EpisodeCount,SeasonCount,Studios,CumulativeRunTimeTicks,Metascore,SeriesStudio&SortOrder=Ascending&Filters=IsNotFolder&ExcludeLocationTypes=Virtual&IncludeItemTypes=Movie&format=json
	Exception of type 'System.OutOfMemoryException' was thrown.
	ServiceStack.HttpError
	No Stack Trace Available
	
2014-12-09 14:13:06.2809 Debug - HttpServer: HTTP Response 500 to 192.168.13.101. Response time: 3437.1626 ms.
	Url: http://192.168.13.198:8096/mediabrowser/Users/f6c51e6fd330e59d16f4cc52886702e1/Items?Recursive=true&SortBy=SortName&Fields=Path,People,Genres,MediaStreams,Overview,ShortOverview,CriticRatingSummary,EpisodeCount,SeasonCount,Studios,CumulativeRunTimeTicks,Metascore,SeriesStudio&SortOrder=Ascending&Filters=IsNotFolder&ExcludeLocationTypes=Virtual&IncludeItemTypes=Movie&format=json
Link to comment
Share on other sites

xnappo

Which goes back to us hammering the server.. We will push something out later today to address that.

Link to comment
Share on other sites

saitoh183

Which goes back to us hammering the server.. We will push something out later today to address that.

 

Alright, looking forward to testing :)

Link to comment
Share on other sites

marcelveldt

I think the Titan 'skin helper' may also be grabbing episodes recursively.

Well, the titan skin helper doesn't have any MB3 specific code anymore, all has been migrated to the mediabrowser skin helper service (which is to be merged with main addon) but I'm pretty sure that it doesn't pull episodes from the server.

Link to comment
Share on other sites

saitoh183

Yeah, something in your environment is especially hard on memory consumption...

 

Well in the resource monitor, MBS is the heaviest memory user in the programs that are always running

 

Utorrent and MBS are the heaviest CPU users.

 

54876b9929cf0_system.jpg

 

 

That is my system in its most idle state i would say... its a application server 

Link to comment
Share on other sites

saitoh183

I am seeing my server hit 800mb and stick there too.  Normally it hangs around 200mb.

 

yeah mine hasnt gone down since i posted earlier...its still at around 750mb now

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...