473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Message: Internal limitation: too many fields.

I have hit a problem where my .exe appears to have too many global variables
and functions
(http://forums.microsoft.com/MSDN/Sho...7548&SiteID=1). This
means my applicaiton dies during startup as the main .exe assembly cannot be
loaded. I understand that the number of fields is limited to ~65k.

As I don't really want to undertake a major restructuring of my code, is
there any way to increase this limit? If I do have to do restructuring
exercise, it would be useful to know how far over the limit I have gone so I
know how much to trim. Is there any way of establishing the number of fields
in an assembly?

Thanks

Colin
Jan 18 '06 #1
2 2337
Colin Desmond wrote:
I have hit a problem where my .exe appears to have too many global
variables and functions
(http://forums.microsoft.com/MSDN/Sho...7548&SiteID=1).
This means my applicaiton dies during startup as the main .exe
assembly cannot be loaded. I understand that the number of fields is
limited to ~65k.

As I don't really want to undertake a major restructuring of my code,
is there any way to increase this limit?
No. It's a hard limit of the CLR. You have no alternative but
re-structuring your code into more, smaller modules. Compiling less of the
code with /clr, or within #pragma unmanaged sections might help too, since
such code is not exposed to the CLR at all.
If I do have to do
restructuring exercise, it would be useful to know how far over the
limit I have gone so I know how much to trim. Is there any way of
establishing the number of fields in an assembly?


Apparently not, according to the thread you cited.

-cd
Jan 18 '06 #2
"Colin Desmond" <Co**********@discussions.microsoft.com> wrote
I have hit a problem where my .exe appears to have too many global
variables
and functions
(http://forums.microsoft.com/MSDN/Sho...7548&SiteID=1).
This
means my applicaiton dies during startup as the main .exe assembly cannot
be
loaded. I understand that the number of fields is limited to ~65k.
IIRC that's the number of _member fields per class_. You could easily
move some of these to other classes.
As I don't really want to undertake a major restructuring of my code, is
there any way to increase this limit? If I do have to do restructuring
exercise, it would be useful to know how far over the limit I have gone so
I
know how much to trim. Is there any way of establishing the number of
fields
in an assembly?

A post-compilation/post-link tool could move these to other classes.
IIRC the fields are sorted by containing typedef at the physical level.
If you managed to define a helper class and convince the linker to
emit it as second typedef after <Module>, you could update its
FieldList.

Granted that's quite a bit of a hack and I'm not even certain
it works ...

You can easily determine the number of global fields with
ildasm /out /METADATA:RAW /METADATA:heaps

Just take a look at the second entry of the typedef table.

-hg
Jan 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: wwight | last post by:
As many people have noticed by now, PHP exhibits some frustrating behavior when it comes to static fields and methods. For instance, when a static method is defined in a parent class, but called...
5
by: Moshe | last post by:
Scenario - IIS 5.0 WIN2K latest SP Application ASP. An ASP Page has a text area. When submitted calls SQL server 2K Stored Procedure to update a record. The field in the data base is of type...
7
by: matthew_carver | last post by:
Hello, I have an ASP page that loops through a SQL Server 2000 table, then downloads an Excel sheet the users can save, etc. Works fine, except, I see that in one particular "comments" field the...
2
by: terpatwork | last post by:
Hi, (1) I have an access form that allows users to enter data, and when they click a button, the OnClick code that I've written uses a SQL INSERT statement to insert the data into the database. I...
0
by: Susan Bricker | last post by:
The following error: "The current field must match the join key '?' in the table that seves as t the 'one' side of one-to-many relationship. Enter a record in the 'one' side table with the...
19
by: cover | last post by:
Is there a restriction to the number of fields you can work with in a PHP to MySQL connection? I'd used as many as 15 quite a few times and now I have a form with 34 fields and can't seem to get...
2
by: fdcm | last post by:
Hi, I am new to Access 2003 on XP. I am creating a database from a current report that has exceeded Excel 2003's row limitation. My concern is running into an Access limitation after creating the...
4
by: leegold58 | last post by:
Hi, Is there a "way around" the size limitation for Access? I'm thinking of something like spanning a huge table accross multiple databases... Something simple and that would preserve the...
9
by: dylan.miller | last post by:
I'm having trouble understanding the internal access modifier. There are many classes in my assembly that should not be accessible outside of the assembly. I've used the internal access modifier...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.