Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. problem with OutOfMemoryException

problem with OutOfMemoryException

Scheduled Pinned Locked Moved C#
help
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Preeti1979
    wrote on last edited by
    #1

    hi every body...........i have a problem.i have a web page in which i m uploading an video file by using fileupload control.......before uploading that video file i m checking the size of that video file by the variable FileBytes.then i m checking it with the drive free space .......but this exception named System.OutOfMemoryException occured when i upload the video file of more than 500 MB...the coding i m using is .......... byte[] FileBytes = FileUpload.FileBytes; // the problem is coming in this line as byte is small datatype for the video file of more than 500 MB long freespace =drInfo.AvailableFeeSpace; i want to upload video files of more than 500 MB ...it may be in GB's also preeti1979

    C M 2 Replies Last reply
    0
    • P Preeti1979

      hi every body...........i have a problem.i have a web page in which i m uploading an video file by using fileupload control.......before uploading that video file i m checking the size of that video file by the variable FileBytes.then i m checking it with the drive free space .......but this exception named System.OutOfMemoryException occured when i upload the video file of more than 500 MB...the coding i m using is .......... byte[] FileBytes = FileUpload.FileBytes; // the problem is coming in this line as byte is small datatype for the video file of more than 500 MB long freespace =drInfo.AvailableFeeSpace; i want to upload video files of more than 500 MB ...it may be in GB's also preeti1979

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      You are trying to store half a gig in RAM. Using this technique you will need sufficient RAM to achieve yout task and allow everything else that is running to continue to do its job.

      Recent blog posts: *Method hiding Vs. overriding *Microsoft Surface *SQL Server / Visual Studio install order My Blog

      P 1 Reply Last reply
      0
      • P Preeti1979

        hi every body...........i have a problem.i have a web page in which i m uploading an video file by using fileupload control.......before uploading that video file i m checking the size of that video file by the variable FileBytes.then i m checking it with the drive free space .......but this exception named System.OutOfMemoryException occured when i upload the video file of more than 500 MB...the coding i m using is .......... byte[] FileBytes = FileUpload.FileBytes; // the problem is coming in this line as byte is small datatype for the video file of more than 500 MB long freespace =drInfo.AvailableFeeSpace; i want to upload video files of more than 500 MB ...it may be in GB's also preeti1979

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        Can you upload without loading the entire file into RAM (i.e. upload in chunks)? Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        1 Reply Last reply
        0
        • C Colin Angus Mackay

          You are trying to store half a gig in RAM. Using this technique you will need sufficient RAM to achieve yout task and allow everything else that is running to continue to do its job.

          Recent blog posts: *Method hiding Vs. overriding *Microsoft Surface *SQL Server / Visual Studio install order My Blog

          P Offline
          P Offline
          Preeti1979
          wrote on last edited by
          #4

          i have sufficient RAM (2 GB) to store these files.but my problem is that whem i m checking the size of the file i m uploading i have taken the datatype as byte which is not sufficient for the files of size more than 500 MB..what data type can i use to store the size (in bytes) of more than 500 MB....

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups