Загрузка больших файлов - System.OutOfMemoryException
Релиб
Форумы       Участники    Календарь    Кто он-лайн?
Добро пожаловать, гость ( Вход | Регистрация )
        



Загрузка больших файлов -... Expand / Collapse
Автор
Сообщение
05.10.2006 0:39
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

участник
Last Login: 28.10.2007 0:53
Сообщ.: 83, Visits: 593
Пытаюсь загрузить видеофильм: 30MB без проблем, а вот при полноразмерном 700MB - вот такая вот ошибка ...

Поставил на странице try везде где только можно, но до них даже не доходит ...

В web.config поставил maxRequestLength="1600000" - насколько понял 1,6 GB ...

Создал свой Application Pool, выставил ему максимальные значения для "virtual memory" и "used memory" - эффекта ноль ...

Полное сообщение об ошибке:

Server Error in '/' Application.
--------------------------------------------------------------------------------
Exception of type System.OutOfMemoryException was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
Stack Trace:
[OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown.]
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300

Trace хоть и включен - ничего не выводит ...

Хочу загружать большие файлы, а вот какие настройки и где крутить?

Сообщ. #905278
05.10.2006 0:54
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

администратор
Last Login: 13.11.2007 13:41
Сообщ.: 4 421, Visits: 49 251
Theoretically, the maximum file upload size is fairly large. However, because of ASP.NET health monitoring, you cannot upload very large files in ASP.NET. The ASP.NET worker process has a virtual address space of 2 gigabytes (GB). However, the ASP.NET worker process only uses a little more than 1 GB because of health monitoring and memory fragmentation.
During the upload process, ASP.NET loads the whole file in memory before the user can save the file to the disk. Therefore, the process may recycle because of the memoryLimit attribute of the processModel tag in the Machine.config file. The memoryLimit attribute specifies the percentage of physical memory that the ASP.NET worker process can exhaust before the process is automatically recycled. Recycling prevents memory leaks from causing ASP.NET to crash or to stop responding.
Additionally, other factors play a role in the maximum file size that can be uploaded. These factors include available memory, available hard disk space, processor speed, and current network traffic. With regular traffic of files being uploaded, Microsoft recommends that you use a maximum file size in the range of 10 to 20 megabytes (MB). If you rarely upload files, the maximum file size may be 100 MB.
Note You can upload files that are larger than 100 MB in ASP.NET. However, Microsoft recommends that you follow the maximum file upload sizes that are mentioned in this article. To determine more precise file sizes, perform stress testing on computers that are similar to the ones that will be used in production.

взято вот отсюда http://support.microsoft.com/default.aspx?scid=kb;en-us;323245&Product=aspnet

решения там нет, но попробуй изменить еще maxRequestLength, потому что он измеряется в Кб, а один Мб равен 1024 Кб, а не 1000... плюс твоя форма может отправлять еще какие-то данные, это не размер файла

Сообщ. #905279
05.10.2006 1:00
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

администратор
Last Login: 13.11.2007 13:41
Сообщ.: 4 421, Visits: 49 251
еще попробуй выставить executionTimeout

например

<httpRuntime executionTimeout="3600"/>

Сообщ. #905280
05.10.2006 4:03
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

участник
Last Login: 28.10.2007 0:53
Сообщ.: 83, Visits: 593
  <httpRuntime
   maxRequestLength="1600000"
   executionTimeout="300"
  />
Время выполнения стоит на 5 мин  - прерывается гдето через 60сек.

maxRequestLength="1600000" - 1562,5 GB - какая разница? - посылаю то я только 700

На форме одно поле "file" и кнопка - больше никаких доп.данных не идет.

Поигрался с размерами файлов - 200MB проходит, дальше нет.

Поставлю вопрос по другому: кто-то пытался получать на asp.net (1.1-2.0) большие файлы и какие настройки при этом пришлось крутить?

Какой максимальный размер удалось принять?

Сообщ. #905283
« пред. тема | след. тема »


Эту тему читают Expand / Collapse
Посетители: 0 (0 гостей, 0 участников, 0 скрыт.участников)
Сейчас нет участников, просматривающих тему.
Модераторы: Alexey, boombastik, bazile, pl, Alexey Spirin

Время GMT +3:00, Сейчас 8:57