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. outofmemoryexception

outofmemoryexception

Scheduled Pinned Locked Moved C#
helpcsharpgame-devcryptographyquestion
5 Posts 5 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.
  • V Offline
    V Offline
    Vineet Rajan
    wrote on last edited by
    #1

    hi all i am making a game using C#. a lot of the game variables, i am storing in hash tables. lately whenever i am trying to run the program i am facing outofmemoryexception. i was not facing this problem before; and has erupted suddenly. can you suggest a better way to store game information? please help vineet

    S A M M 4 Replies Last reply
    0
    • V Vineet Rajan

      hi all i am making a game using C#. a lot of the game variables, i am storing in hash tables. lately whenever i am trying to run the program i am facing outofmemoryexception. i was not facing this problem before; and has erupted suddenly. can you suggest a better way to store game information? please help vineet

      S Offline
      S Offline
      Steve Hansen
      wrote on last edited by
      #2

      What kind of data and how much are you talking about?

      1 Reply Last reply
      0
      • V Vineet Rajan

        hi all i am making a game using C#. a lot of the game variables, i am storing in hash tables. lately whenever i am trying to run the program i am facing outofmemoryexception. i was not facing this problem before; and has erupted suddenly. can you suggest a better way to store game information? please help vineet

        A Offline
        A Offline
        albCode
        wrote on last edited by
        #3

        I suggest to not use much variables because it become large proccess when u run it and slows ur PC as well.. _____________________ Proud to be Albanian _____________________

        1 Reply Last reply
        0
        • V Vineet Rajan

          hi all i am making a game using C#. a lot of the game variables, i am storing in hash tables. lately whenever i am trying to run the program i am facing outofmemoryexception. i was not facing this problem before; and has erupted suddenly. can you suggest a better way to store game information? please help vineet

          M Offline
          M Offline
          malharone
          wrote on last edited by
          #4

          Besure to dispose of all graphics objects .. eg. Brush / Graphics / Pen etc.

          1 Reply Last reply
          0
          • V Vineet Rajan

            hi all i am making a game using C#. a lot of the game variables, i am storing in hash tables. lately whenever i am trying to run the program i am facing outofmemoryexception. i was not facing this problem before; and has erupted suddenly. can you suggest a better way to store game information? please help vineet

            M Offline
            M Offline
            mcljava
            wrote on last edited by
            #5

            The key thing I hear is "Hash Tables", i.e. plural. Sounds lke you have a added so much data that you have basiscaly overfilled the sink. The answer I am about to give may not be easy to deal with but it sounds like you are at the point of fix or scrap. Here is what I would do: First perform a full evaluation of the design to determine how much data really needs to store in a persistent manner, how much is ephemeral in nature, and finally what is the best way to store all this stuff? Remember a hash table is a fair amount of code that comes at the expense of memory. However in a game "speed" is the chief criterion. Thus finding a viable storage mechanism and keeping memory utlization reasonable should guide the solution. For these reasons I would think about creating a more efficient storage strategy. This takes into account things like graphics, you only need one copy and after that you should only store the deltas. Sure this means GDI programming but your are writing a game afterall. Game design is almost always equated with system code, and in C# that equates to unmanaged code. If you create a memory storage strategy and implement memory allocatio via Marshalled OS calls and pointers, then you are on the right track. For sure, any game write should know exactly how much data needs to be stored, how much needs to be paged in from disk, etc. Although C# is nice for lots of applications, I personally would use C++ for a game because of the closer fit to the OS. At the same time you can always write DLLs in C++ if you need the performance tweaks. Good Luck Mike Luster CTI/IVR/Telephony SME

            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