Results 1 to 13 of 13

Thread: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    I get this error System.OutOfMemory
    What's the solution?
    I have about 10 forms in one project, And I just attached one song using the resource method, then memories done?
    Should I add more memory? How do I add more?
    Thanks in Advance

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    How big is your music file? How are you using it?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    Also, when and where are you getting the Exception?

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,375

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    Another important question is how are you playing the audio? Are you using My.Computer.Audio.Play, XNA, DirectX, etc.? I would also suggest reading an article by TechGnome, here.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    When it was in .mp3 format it was about 7MB, but when I converted to .wav it became about 30+MB, I felt that was something awkward..

    I'm using it in the .wav format, and putting it in resources and using the My.Computer.Audio.Play method...

  6. #6

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    I'm getting the Exception when I Debug the program and Run it...
    Also, when I "build" it "fails"

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    jmcilhinney: The files about 5MB when in the .MP3 format, but when I convert using a tool, it's about 36MB, That's awkward...
    I'm Using it in .wav format. Using the resource method, My.Computer.Audio.Play

    formlesstree4: I'm getting the Exception when I click "Start" the program and Run it...
    Also, when I "build" it "fails"

    dday9: Sorry for the less info, and Yes, I'm using the My.computer.Audio.Play(My.Resources."Mysong", AudioPlayModeBackground)

  8. #8
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    My.computer.Audio.Play(My.Resources."Mysong", AudioPlayModeBackground)
    Lose the quotation marks!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  9. #9

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    Quote Originally Posted by dunfiddlin View Post
    Lose the quotation marks!
    Yeah, I know that, I just put it so that you wouldn't get confused!

  10. #10
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    How does it behave if you delete your present wav file from resources and use a different one -- preferably a wav file you are certain will play? The reason I ask is that OutOfMemory exceptions sometimes occur when a file is not in the expected format -- nothing to do with system memory.

    BB

  11. #11

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    6

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    Quote Originally Posted by boops boops View Post
    How does it behave if you delete your present wav file from resources and use a different one -- preferably a wav file you are certain will play? The reason I ask is that OutOfMemory exceptions sometimes occur when a file is not in the expected format -- nothing to do with system memory.

    BB

    If I delete the present wav file, then it's like all the changes I make for E.g adding buttons, adding new forms, adding pictures etc. will not happen, It will be the same way, I saved with the wav file , It;s like the Design Time Changes don't happen during Run time....

    These wav files are like 35MB+

    Any way which you can add mp3 file as a resource?
    That way it would have been better, but don't think it's possible? :/

  12. #12
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    Quote Originally Posted by Amith7798 View Post
    If I delete the present wav file, then it's like all the changes I make for E.g adding buttons, adding new forms, adding pictures etc. will not happen, It will be the same way, I saved with the wav file , It;s like the Design Time Changes don't happen during Run time....

    These wav files are like 35MB+
    Actually you don't need to delete the 35MB wav file, just add a new wav file to resources. Take some wav file that is obviously ok, like ding.wav from the system files. In your code, change the name of the resource to My.Resources.Ding (or whatever) and see if it works. If it does, there is nothing wrong with your code but something wrong with the original file.

    Any way which you can add mp3 file as a resource?
    That way it would have been better, but don't think it's possible? :/
    As far as I know an mp3 file has to be on disk so you can play with Windows Media Player, bass.dll etc. But someone else may know better.

    BB

  13. #13
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: Visual Basic 2010: System.OutOfMemory error? How do I resolve this?

    #Off VB topic#

    Care to send over the mp3 7mb?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width