C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #16  
Old April 12th, 2003, 01:07 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,589 Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level)Scorpions4ever User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 1 m 37 sec
Reputation Power: 1001
Yep, I duplicated your problem when I changed F to 25. I think that you've reached a compiler limitation. Here's the problem:
When F=25,
ftV has 26 * 26 * 26 *1024 elements
Now ftV is of type Extended, which means that each element takes 10 bytes of memory.
Hence, total memory taken by the declaration of ftV is
ftV Mem Size = 26 * 26 * 26 * 1024 * 10
= 179978240 bytes
= 0xABA4000 bytes in hex.

Now, if you go to Project --> Options --> Linker, the max heap size (or max. stack size) it allows you to set is 0x1000000. Unfortunately this is less than 0xABA4000, so your compiler can't allocate this memory for you. You might want to talk to borland about it.

Reply With Quote
  #17  
Old April 13th, 2003, 02:19 PM
marek_haj's Avatar
marek_haj marek_haj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: currently Lisbone, Portugal
Posts: 154 marek_haj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 28 m
Reputation Power: 6
welcome back, sorry for late writing but I had to move from Portugal back to Poladn and it took three days. Quite a long way to go.
I am really grateful for Your help. Now that I know what the problems is exactly, I might try contacting that guys at Borland. Perhaps they might works somethign out to fix this problem.
Perhaps changing the type of matrix into float might fix the problem, though then the results I get are not as exact as I want them to be, such probabilites are usually very small so I need all the precision I get.
Thanks once again. I will let You knwo what they repond to my question.
Best greets
MArek

Reply With Quote
  #18  
Old April 14th, 2003, 07:46 AM
Jason Doucette's Avatar
Jason Doucette Jason Doucette is offline
jasondoucette.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada
Posts: 378 Jason Doucette User rank is Private First Class (20 - 50 Reputation Level)Jason Doucette User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 h 23 m 8 sec
Reputation Power: 6
Quote:
Originally posted by Scorpions4ever
... Now, if you go to Project --> Options --> Linker, the max heap size (or max. stack size) it allows you to set is 0x1000000. Unfortunately this is less than 0xABA4000, so your compiler can't allocate this memory for you. You might want to talk to borland about it.
I just attempted to compile a program that requires over 300 MB of data (for a legit reason - I am using pre-calc tables for optimizations), and it gives the following error (MSVC++ 6.0):

warning LNK4084: total image size 387477504 exceeds max (268435456); image may not run

The program runs as expected on my system (WinXP), but I wondered why it's saying "image may not run". I did a search for the Internet for this error, which doesn't have much on it, but I did find this page:

http://h18009.www1.hp.com/fortran/kb/q1019.html

And it states:

"Windows 95 and Windows NT 4.0 have a limit for the total size of static code and data of 256MB. If the amount of static code and data exceeds this size, the image may not execute. This is a limitation in the operating system and not in Visual Fortran or its tools. ... If the actual image size is displayed as a negative value, that means that the image size exceeds 2GB and your program will not run on any version of 32-bit Windows."

which implies the same is also true for Visual C++ (i.e. it is a limit of the OS, and not the compiler)

It also states: "Solution: For Windows NT 4.0, install Microsoft's Windows NT Service Pack 3 (or later). This raises the limit on static code and data to 1.75GB. However, the linker is not modified by this update and will continue to issue the warning, which can be ignored. The limit on Windows 98, Windows 2000 and Windows XP is 1.75GB, the same as Windows NT 4.0 with Service Pack 3 - if your application will be not be running on Windows 95, or on Windows NT 4.0 prior to SP3, and the actual image size is not displayed as a negative value, you can ignore this message. ... For Windows 95, Microsoft has not released an update which raises the limit."

So, it sounds like the limit is not 256 MB if you have the right OS, although you will still get the linker error. I have not tested my program on a Win95 machine to see if it works or not.

NOTE: if you dynamically allocate the memory, this limitation does NOT exist.

Reply With Quote
  #19  
Old April 14th, 2003, 01:43 PM
marek_haj's Avatar
marek_haj marek_haj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: currently Lisbone, Portugal
Posts: 154 marek_haj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 28 m
Reputation Power: 6
Welcome back
so the ides seems to be: just install the SP3 for WIn2000 and forget about the error, becasue it will be presented but the exe file should work. Well, it does not since it is created just partially. Teh size is too small for it to be complete.
I also tried allocating the memory dynamically and all I got was "error in the Vmem.c library. Abnormal program termination".
Got that twice.
Perhaps You could write me how to allocate that? Perhaps I do that in a wronf way or something. I am running out of ideas.
Thanks a lot
Best wishes
Marek

Reply With Quote
  #20  
Old April 14th, 2003, 05:02 PM
Jason Doucette's Avatar
Jason Doucette Jason Doucette is offline
jasondoucette.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada
Posts: 378 Jason Doucette User rank is Private First Class (20 - 50 Reputation Level)Jason Doucette User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 h 23 m 8 sec
Reputation Power: 6
Remember, the warning I showed you above is a linker warning, not an error. It compiles, and it links into an .exe. The problem lies in whether or not your OS can run it. Some can, and some can't. Read my previous post to see which can.

If this is the only warning you are getting, and you have an OS that can run it properly, then you do not have a problem (unless you plan on giving your software to people who do not have the appropriate OS). If this is NOT the only warning (or if you are getting errors), then you have more problems than this.

If this size limit does not exist for dynamic allocation, you should be able to use the new operator as you would normally use it for arrays, and it should work.

Reply With Quote
  #21  
Old April 14th, 2003, 11:41 PM
marek_haj's Avatar
marek_haj marek_haj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: currently Lisbone, Portugal
Posts: 154 marek_haj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 28 m
Reputation Power: 6
I understand.
The problem is I receive a linker error on Windows2000 with SP3, which according toYour post should have such problem elliminated. Maybe I will just stick to lower matrix sizes, to lets's say 10x10x10x1024, the proffessor is not going to kill me for that after all.
Thank You for all Your help. It was priceless.
Best regards
Marek

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Maximum matrix size


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT