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. The Lounge
  3. Limit of Programming

Limit of Programming

Scheduled Pinned Locked Moved The Lounge
comhelpquestionannouncement
36 Posts 18 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.
  • C Christian Graus

    "The limit for the number of fields in a class on the CLR is 65536." I'm sorry, I don't think I'll ever hit that limit.

    Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

    R Offline
    R Offline
    Rama Krishna Vavilala
    wrote on last edited by
    #17

    It is possible to reach the limit of you are using C++\CLI and don't partition your projects correctly or use header's incorrectly. That's one of the main reasons I don't like C++\CLI: adds too much junk to the metadata.


    1 Reply Last reply
    0
    • A Aamir Butt

      So, today I managed to reach there ;P This[^] is what I am talking about. I reached this milestone today and am advised by the Microsoft guy to break my module into further smaller modules to avoid getting this problem again. Being at a late stage of a release, I simply can't do it. Thanks to another guy who advised another workaround related to 'String Pooling' due to which I am back on track. But I was just wondering if 65K limit is enough for big commercial apps.

      "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

      N Offline
      N Offline
      NormDroid
      wrote on last edited by
      #18

      Your handywork or someone elses ( I hope ). X|

      We made the buttons on the screen look so good you'll want to lick them. Steve Jobs

      1 Reply Last reply
      0
      • A Aamir Butt

        So, today I managed to reach there ;P This[^] is what I am talking about. I reached this milestone today and am advised by the Microsoft guy to break my module into further smaller modules to avoid getting this problem again. Being at a late stage of a release, I simply can't do it. Thanks to another guy who advised another workaround related to 'String Pooling' due to which I am back on track. But I was just wondering if 65K limit is enough for big commercial apps.

        "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

        J Offline
        J Offline
        Jun Du
        wrote on last edited by
        #19

        Instead of throwing a run-time exception, Microsoft should have put that limit as a compile-time constraint.

        Best, Jun

        M 1 Reply Last reply
        0
        • M Michael P Butler

          Aamir Butt wrote:

          ut I was just wondering if 65K limit is enough for big commercial apps.

          65K. What the hell are you writing! I hesitate to say bad design without knowing what problem your application was built to solve, but it sounds very badly designed to me.

          Michael CP Blog [^] Development Blog [^]

          E Offline
          E Offline
          El Corazon
          wrote on last edited by
          #20

          Michael P Butler wrote:

          without knowing what problem your application was built to solve

          I am curious too. I have some huge classes and large number of globals as I try to fix some design issues of the past. But my software does so many things it sometimes surprises me how bloated it is. But the core is solid which was how I survived even with some bad designs on some of the objects. That large of number of members and the application had better bring world peace!

          _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

          1 Reply Last reply
          0
          • J Jun Du

            Instead of throwing a run-time exception, Microsoft should have put that limit as a compile-time constraint.

            Best, Jun

            M Offline
            M Offline
            Marc Clifton
            wrote on last edited by
            #21

            Jun Du wrote:

            Microsoft should have put that limit as a compile-time constraint.

            Which would just get abused. /globalLimit=4294967295 ;P Marc

            Thyme In The Country

            Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson
            People are just notoriously impossible. --DavidCrow
            There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer

            1 Reply Last reply
            0
            • A Aamir Butt

              So, today I managed to reach there ;P This[^] is what I am talking about. I reached this milestone today and am advised by the Microsoft guy to break my module into further smaller modules to avoid getting this problem again. Being at a late stage of a release, I simply can't do it. Thanks to another guy who advised another workaround related to 'String Pooling' due to which I am back on track. But I was just wondering if 65K limit is enough for big commercial apps.

              "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

              J Offline
              J Offline
              Jeremy Falcon
              wrote on last edited by
              #22

              I've worked at a company that hit a similar limit in VB6 for a medical app. Let's just say, the app was a pile of crap to begin with. No offense man, but it's time to refactor if it won't compile and/or run.

              Jeremy Falcon

              1 Reply Last reply
              0
              • J Jun Du

                It is good to know the limit! Considering people are delivering software in gigabyte (on DVD) now, that doesn't seem to be a big number.

                Best, Jun

                E Offline
                E Offline
                El Corazon
                wrote on last edited by
                #23

                Jun Du wrote:

                Considering people are delivering software in gigabyte (on DVD) now

                err... four DVD's for full distribution... five if you want the experimental voice system. I live on the edge... :->

                _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                1 Reply Last reply
                0
                • A Aamir Butt

                  So, today I managed to reach there ;P This[^] is what I am talking about. I reached this milestone today and am advised by the Microsoft guy to break my module into further smaller modules to avoid getting this problem again. Being at a late stage of a release, I simply can't do it. Thanks to another guy who advised another workaround related to 'String Pooling' due to which I am back on track. But I was just wondering if 65K limit is enough for big commercial apps.

                  "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

                  B Offline
                  B Offline
                  brianwelsch
                  wrote on last edited by
                  #24

                  We get this issue in our assembler crap code. A developer the other day had code that wouldn't assemble correctly because the program crossed the 64K limit. So now a 2 day fix turns into 1 week rewrite of a block of code. Really frustrating writing for old systems. [Misunderstood your problem. Mine is a memory size issue.] -- modified at 11:10 Thursday 17th August, 2006

                  BW


                  If you're not part of the solution, you're part of the precipitate.
                  -- Steven Wright

                  1 Reply Last reply
                  0
                  • J Judah Gabriel Himango

                    65 thousand some globals? Dear Lord.

                    Tech, life, family, faith: Give me a visit. I'm currently blogging about: And in this corner, the Party of Allah The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

                    A Offline
                    A Offline
                    Anna Jayne Metcalfe
                    wrote on last edited by
                    #25

                    As I read it, the globals referred to are primarily a consequence of the way the C++/CLI build process - it seems that each literal string (for example) generates such a FieldRVA entry: "The limit for the number of fields in a class on the CLR is 65536. The <Module> class is the name for the container of all global variables and functions. The VC2005 compiler generates more global names in metadata than the VC2003 release (part of this is to support initialization on managed code paths)." If I read the MSDN forum posts correctly, this issue can hit any large-ish mixed-mode assembly - even if the code does not include a single global method or piece of data! :~

                    Anna :rose: Currently working mostly on: Visual Lint :cool: Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

                    E L A 3 Replies Last reply
                    0
                    • C Chris Losinger

                      i've seen SQL stored-procs with 6000 lines. i completely refused to work on that part of the application.

                      image processing | blogging

                      P Offline
                      P Offline
                      Paul Conrad
                      wrote on last edited by
                      #26

                      Chris Losinger wrote:

                      i've seen SQL stored-procs with 6000 lines.

                      :omg: Geeze, and I thought I was bad with a 50 line stored procedure :->


                      That's no moon, it's a space station. - Obi-wan Kenobi

                      1 Reply Last reply
                      0
                      • A Anna Jayne Metcalfe

                        As I read it, the globals referred to are primarily a consequence of the way the C++/CLI build process - it seems that each literal string (for example) generates such a FieldRVA entry: "The limit for the number of fields in a class on the CLR is 65536. The <Module> class is the name for the container of all global variables and functions. The VC2005 compiler generates more global names in metadata than the VC2003 release (part of this is to support initialization on managed code paths)." If I read the MSDN forum posts correctly, this issue can hit any large-ish mixed-mode assembly - even if the code does not include a single global method or piece of data! :~

                        Anna :rose: Currently working mostly on: Visual Lint :cool: Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

                        E Offline
                        E Offline
                        El Corazon
                        wrote on last edited by
                        #27

                        Anna-Jayne Metcalfe wrote:

                        If I read the MSDN forum posts correctly, this issue can hit any large-ish mixed-mode assembly - even if the code does not include a single global method or piece of data!

                        :~ seconded!

                        _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                        1 Reply Last reply
                        0
                        • A Anna Jayne Metcalfe

                          As I read it, the globals referred to are primarily a consequence of the way the C++/CLI build process - it seems that each literal string (for example) generates such a FieldRVA entry: "The limit for the number of fields in a class on the CLR is 65536. The <Module> class is the name for the container of all global variables and functions. The VC2005 compiler generates more global names in metadata than the VC2003 release (part of this is to support initialization on managed code paths)." If I read the MSDN forum posts correctly, this issue can hit any large-ish mixed-mode assembly - even if the code does not include a single global method or piece of data! :~

                          Anna :rose: Currently working mostly on: Visual Lint :cool: Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

                          L Offline
                          L Offline
                          led mike
                          wrote on last edited by
                          #28

                          Anna-Jayne Metcalfe wrote:

                          it seems that each literal string

                          string literals are as bad as globals. From where I sit the finger is still pointing the same direction.

                          led mike

                          A 1 Reply Last reply
                          0
                          • L led mike

                            Anna-Jayne Metcalfe wrote:

                            it seems that each literal string

                            string literals are as bad as globals. From where I sit the finger is still pointing the same direction.

                            led mike

                            A Offline
                            A Offline
                            Anna Jayne Metcalfe
                            wrote on last edited by
                            #29

                            In production code, that's largely true (user text should all be in the string table, of course!). However, this issue would also hit TRACE statements, ASSERTs, etc, so its impact could be significantly greater than you expect - particularly in debug builds.

                            Anna :rose: Currently working mostly on: Visual Lint :cool: Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

                            L 1 Reply Last reply
                            0
                            • A Anna Jayne Metcalfe

                              In production code, that's largely true (user text should all be in the string table, of course!). However, this issue would also hit TRACE statements, ASSERTs, etc, so its impact could be significantly greater than you expect - particularly in debug builds.

                              Anna :rose: Currently working mostly on: Visual Lint :cool: Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

                              L Offline
                              L Offline
                              led mike
                              wrote on last edited by
                              #30

                              Anna-Jayne Metcalfe wrote:

                              so its impact could be significantly greater than you expect - particularly in debug builds.

                              Perhaps but I remain very sceptical. :suss:

                              led mike

                              1 Reply Last reply
                              0
                              • R Ray Kinsella

                                How the hell do you hit that limit ... :wtf:

                                Regards Ray "Je Suis Mort De Rire" Blogging @ Keratoconus Watch

                                A Offline
                                A Offline
                                Aamir Butt
                                wrote on last edited by
                                #31

                                That is not the limit for a single class. In fact, the Field values are generated for the entire assembly and for an assembly (which is mixed mode) it is not too big a number.

                                "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

                                1 Reply Last reply
                                0
                                • M Michael P Butler

                                  Aamir Butt wrote:

                                  ut I was just wondering if 65K limit is enough for big commercial apps.

                                  65K. What the hell are you writing! I hesitate to say bad design without knowing what problem your application was built to solve, but it sounds very badly designed to me.

                                  Michael CP Blog [^] Development Blog [^]

                                  A Offline
                                  A Offline
                                  Aamir Butt
                                  wrote on last edited by
                                  #32

                                  No, its not that badly designed. I am writing a Visio like thing in which you can create different things by dragging/dropping the objects. I am using 2 external UI libraries as well which are making it a bit heavy but the final executable size is just 1.4 MB which is not too big IMO. The problem is with the metadata generation in Visual Studio 2005. This seems to be a bug to me because just by enabling 'String Pooling' the field entries are reduced to almost 1/3rd.

                                  "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

                                  1 Reply Last reply
                                  0
                                  • A Anna Jayne Metcalfe

                                    As I read it, the globals referred to are primarily a consequence of the way the C++/CLI build process - it seems that each literal string (for example) generates such a FieldRVA entry: "The limit for the number of fields in a class on the CLR is 65536. The <Module> class is the name for the container of all global variables and functions. The VC2005 compiler generates more global names in metadata than the VC2003 release (part of this is to support initialization on managed code paths)." If I read the MSDN forum posts correctly, this issue can hit any large-ish mixed-mode assembly - even if the code does not include a single global method or piece of data! :~

                                    Anna :rose: Currently working mostly on: Visual Lint :cool: Anna's Place | Tears and Laughter "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work.

                                    A Offline
                                    A Offline
                                    Aamir Butt
                                    wrote on last edited by
                                    #33

                                    You are absolutely right. :) Good to see someone understanding the real problem. :rose:

                                    "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

                                    1 Reply Last reply
                                    0
                                    • E El Corazon

                                      Aamir Butt wrote:

                                      But I was just wondering if 65K limit is enough for big commercial apps.

                                      What does your application do? I have never run into this issue, and I push the memory limit to 1.8+gb, I push every limit I possibly can, but I guess I never pushed that one. Yes you should break your module into further smaller modules, not just because of some microsoft limit. 1) Efficiency. Chances are if you have modules that large, you are brute-forcing the machine. I have been accused of the same, and sometimes it is true. I did brute-force one map, I am currently rewriting it to be about 50 times more efficient. 2) Cache use. I guess this goes into efficiency, but you are talking about efficiency related to specific application of hardware. Instruction and memory cache operations will increase your speed two-fold, if you aren't breaking your functions at least to fit into the caches then you are your applications' own worst enemies. 3) maintenance. Other people would put this first, and there is a good reason to do so. If you want your application to last, you want to write it to last multiple releases. You will do rewrites, or at least you better if you want it to last multiple major releases, but you want to at least write something solid enough that you can make modifications: bug fixes and improvements. If your goal is to write code that will never be changed, ever, you're in the wrong business.

                                      _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                                      A Offline
                                      A Offline
                                      Aamir Butt
                                      wrote on last edited by
                                      #34

                                      I replied to someone else as well. I dont think that my app is badly modularized. Just a parameter, my final executable size is only 1.4 MB (and yes, its debug). Another parameter, I just checked, I have only 3 global variables, there are some static methods (15 or so) but those are methods(again nothing like huge static strings). The problem as I suspect lies with the metadata generation for mixed mode assemblies.

                                      "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

                                      1 Reply Last reply
                                      0
                                      • J Judah Gabriel Himango

                                        65 thousand some globals? Dear Lord.

                                        Tech, life, family, faith: Give me a visit. I'm currently blogging about: And in this corner, the Party of Allah The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

                                        A Offline
                                        A Offline
                                        Aamir Butt
                                        wrote on last edited by
                                        #35

                                        Not really globals. Had you read entire thread, your opinion might have been different. I have replied to other guys explaining the real problem. Please have a look.

                                        "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

                                        J 1 Reply Last reply
                                        0
                                        • A Aamir Butt

                                          Not really globals. Had you read entire thread, your opinion might have been different. I have replied to other guys explaining the real problem. Please have a look.

                                          "Some people believe football is a matter of life and death. I'm very disappointed with that attitude. I can assure you it is much, much more important than that. -- Bill Shankly"

                                          J Offline
                                          J Offline
                                          Judah Gabriel Himango
                                          wrote on last edited by
                                          #36

                                          I see that Mr. Butt. When I heard 65k globals, I just instinctively thought it was globals you manually typed out.

                                          Tech, life, family, faith: Give me a visit. I'm currently blogging about: And in this corner, the Party of Allah The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

                                          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