Out of Memory Importing Series in Batch

So, like i warned, i am the perfect candidate to find bugs and usability shortfalls because of the sheer size of my libraries. :smile:

I am now at TV Shows 12 folder importing and sonarr crashed. The service stopped completely. After restarting it, i looked at the logs and i got the following:

SeriesModule failed while processing [EpisodeImportedEvent]: out of memory
out of memory
  System.Data.SQLite.SQLiteException (0x80004005): out of memory
out of memory
   at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Marr.Data.DataMapper.Find[T](String sql, T ent) in m:\BuildAgent1\work\328d72309b633a8\src\Marr.Data\DataMapper.cs:line 487
   at Marr.Data.DataMapper.Find[T](String sql) in m:\BuildAgent1\work\328d72309b633a8\src\Marr.Data\DataMapper.cs:line 462
   at NzbDrone.Core.SeriesStats.SeriesStatisticsRepository.SeriesStatistics(Int32 seriesId) in m:\BuildAgent1\work\328d72309b633a8\src\NzbDrone.Core\SeriesStats\SeriesStatisticsRepository.cs:line 52
   at NzbDrone.Core.SeriesStats.SeriesStatisticsService.SeriesStatistics(Int32 seriesId) in m:\BuildAgent1\work\328d72309b633a8\src\NzbDrone.Core\SeriesStats\SeriesStatisticsService.cs:line 27
   at NzbDrone.Api.Series.SeriesModule.FetchAndLinkSeriesStatistics(SeriesResource resource) in m:\BuildAgent1\work\328d72309b633a8\src\NzbDrone.Api\Series\SeriesModule.cs:line 144
   at NzbDrone.Api.Series.SeriesModule.GetSeriesResource(Series series) in m:\BuildAgent1\work\328d72309b633a8\src\NzbDrone.Api\Series\SeriesModule.cs:line 91
   at NzbDrone.Api.Series.SeriesModule.GetSeries(Int32 id) in m:\BuildAgent1\work\328d72309b633a8\src\NzbDrone.Api\Series\SeriesModule.cs:line 81
   at NzbDrone.Api.NzbDroneRestModuleWithSignalR`2.BroadcastResourceChange(ModelAction action, Int32 id) in m:\BuildAgent1\work\328d72309b633a8\src\NzbDrone.Api\NzbDroneRestModuleWithSignalR.cs:line 38
   at NzbDrone.Api.Series.SeriesModule.Handle(EpisodeImportedEvent message) in m:\BuildAgent1\work\328d72309b633a8\src\NzbDrone.Api\Series\SeriesModule.cs:line 186
   at NzbDrone.Core.Messaging.Events.EventAggregator.PublishEvent[TEvent](TEvent event) in m:\BuildAgent1\work\328d72309b633a8\src\NzbDrone.Core\Messaging\Events\EventAggregator.cs:line 56

FYI This is running on a Windows 7 64-bit, Core i5, 8GB of RAM

Before it happened, i got a bunch of errors about the database being locked. They were thrown by the EpisodeService and MetadataFileService.

Now i have shows where it is telling me i am missing an episode but the file is there. Obviously it crashed while scanning. Because of this, i have a flurry of questions:

  • Will that be rectified in 12 hours once it refreshes?
  • Will it refresh all shows or only continuing ones and the ended ones will be refreshed in 30 days?
  • When it refreshes, will it set the video dates to the Local Air Date if setting is enabled? (Amazing feature BTW! I asked for this in 3 other products only to be denied!)

So far i am loving sonarr and am almost done importing shows. Just need that fix for series not found pushed to dev :wink:

Keep up the awesome work!

P.S. here is the log file. Few errors here and there but major problems start at 11:39pm.

I suspect the error was due to simultaneous updating of multiple series due to adding them in batch.

Yes, it should update normally (which processes them one at a time, so it will take a bit, but it won’t use a lot of memory either).

Continuing only, the best thing to do to force a refresh of all series is to run it from the main screen “Refresh all Series” that will process every series, including ended ones.

Taking a quick look at the code, yes it should.