Limit of Programming
-
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"
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
-
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
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)
-
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"
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 -
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
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.
-
i've seen SQL stored-procs with 6000 lines. i completely refused to work on that part of the application.
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
-
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.
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)
-
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.
-
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
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.
-
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.
-
How the hell do you hit that limit ... :wtf:
Regards Ray "Je Suis Mort De Rire" Blogging @ Keratoconus Watch
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"
-
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 [^]
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"
-
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.
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"
-
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)
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"
-
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
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"
-
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"
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