473,756 Members | 4,256 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Out of Memory" error during Borland C++ 5.02 compile

Why?
Running on windows 2000 with all updates, 2G Memory, 117G Hard Drive
space available.

This was not an issue until I added some code to two of my c files.
Any suggestions?
Thanks

Nov 14 '05 #1
10 4704
<11************ **********@g14g 2000cwa.googleg roups.com>
sc*****@hotpop. com wrote:
This was not an issue until I added some code to two of my c files.


If you get this error during compilation, it's a Borland problem, not
a C problem. Take it to the groups at newsgroups.borl and.com and you'll
get a solution rather than flames.

--
Christopher Benson-Manica
ataru(at)cybers pace.org
Nov 14 '05 #2
sc*****@hotpop. com wrote:
Why?
Running on windows 2000 with all updates, 2G Memory, 117G Hard Drive
space available.

This was not an issue until I added some code to two of my c files.
Any suggestions?


Did you try to ask in a newsgroup devoted to Borland C++ ?
Nov 14 '05 #3
In article <d0**********@n ews-rocq.inria.fr>,
Grumble <de*****@kma.eu .org> wrote:
sc*****@hotpop .com wrote:
Why?
Running on windows 2000 with all updates, 2G Memory, 117G Hard Drive
space available.

This was not an issue until I added some code to two of my c files.
Any suggestions?


Did you try to ask in a newsgroup devoted to Borland C++ ?


Well, the obvious answer is: delete that code that caused the problem.

The somewhat less obvious answer is: post the code that caused the problem
here, so we can tell you what's wrong with it.

Nov 14 '05 #4
ga*****@yin.int eraccess.com (Kenny McCormack) writes:
In article <d0**********@n ews-rocq.inria.fr>,
Grumble <de*****@kma.eu .org> wrote:
sc*****@hotpo p.com wrote:
Why?
Running on windows 2000 with all updates, 2G Memory, 117G Hard Drive
space available.

This was not an issue until I added some code to two of my c files.
Any suggestions?


Did you try to ask in a newsgroup devoted to Borland C++ ?


Well, the obvious answer is: delete that code that caused the problem.

The somewhat less obvious answer is: post the code that caused the problem
here, so we can tell you what's wrong with it.


That's unlikely to be useful. There is no C construct that would be
expected to cause a compiler to run out of memory (unless it's just an
incredibly huge program, but I don't think that's the case here given
the resources available on the system). This is a Borland-specific
problem; we lack the expertise to help you with it here.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #5
In article <ln************ @nuthaus.mib.or g>,
Keith Thompson <ks***@mib.or g> wrote:
ga*****@yin.in teraccess.com (Kenny McCormack) writes:
In article <d0**********@n ews-rocq.inria.fr>,
Grumble <de*****@kma.eu .org> wrote:
sc*****@hotp op.com wrote:

Why?
Running on windows 2000 with all updates, 2G Memory, 117G Hard Drive
space available.

This was not an issue until I added some code to two of my c files.
Any suggestions?

Did you try to ask in a newsgroup devoted to Borland C++ ?


Well, the obvious answer is: delete that code that caused the problem.

The somewhat less obvious answer is: post the code that caused the problem
here, so we can tell you what's wrong with it.


That's unlikely to be useful. There is no C construct that would be
expected to cause a compiler to run out of memory (unless it's just an
incredibly huge program, but I don't think that's the case here given
the resources available on the system). This is a Borland-specific
problem; we lack the expertise to help you with it here.


Help *me* with it? Surely, you mean "help the OP".

Anyway, get serious. One of the basic tenets of this NG is that if you
"invoke UB", anything can happen - and "anything" surely includes a compiler
blowing memory. Remember, the OP did say that it was working until he
added "a couple of lines of code". What if those "couple of lines of code"
were declaring a very (very!) large automatic variable (array)?

Yes, I am aware there is a grey area here (between compile-time behavior
and run-time behavior), but these days, those lines are blurred. My bet is
there's something wrong with those lines of code (or his story isn't
accurate).

Nov 14 '05 #6
ga*****@yin.int eraccess.com (Kenny McCormack) writes:
In article <ln************ @nuthaus.mib.or g>,
Keith Thompson <ks***@mib.or g> wrote:
ga*****@yin.i nteraccess.com (Kenny McCormack) writes: [...]
The somewhat less obvious answer is: post the code that caused the problem
here, so we can tell you what's wrong with it.
That's unlikely to be useful. There is no C construct that would be
expected to cause a compiler to run out of memory (unless it's just an
incredibly huge program, but I don't think that's the case here given
the resources available on the system). This is a Borland-specific
problem; we lack the expertise to help you with it here.


Help *me* with it? Surely, you mean "help the OP".


Of course.
Anyway, get serious. One of the basic tenets of this NG is that if you
"invoke UB", anything can happen - and "anything" surely includes a compiler
blowing memory. Remember, the OP did say that it was working until he
added "a couple of lines of code". What if those "couple of lines of code"
were declaring a very (very!) large automatic variable (array)?
Declaring a large array uses memory at run time, not at compilation time.

If the "couple of lines of code" invoke undefined behavior, all we'd
be able to tell the OP is that they invoke undefined behavior.
There's no way we could guess that they could cause the compiler to
run out of memory.
Yes, I am aware there is a grey area here (between compile-time behavior
and run-time behavior), but these days, those lines are blurred. My bet is
there's something wrong with those lines of code (or his story isn't
accurate).


My bet is that there's something wrong with the compiler.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #7
Keith Thompson wrote:

... There is no C construct that would be expected to cause a
compiler to run out of memory (unless it's just an incredibly
huge program, ...


It doesn't have to be 'incredibly huge'. The following 21 lines
crashes my port of gcc...

#define BC1(p) p,1+p
#define BC2(p) BC1(p),BC1(1+p)
#define BC3(p) BC2(p),BC2(1+p)
#define BC4(p) BC3(p),BC3(1+p)
#define BC5(p) BC4(p),BC4(1+p)
#define BC6(p) BC5(p),BC5(1+p)
#define BC7(p) BC6(p),BC6(1+p)
#define BC8(p) BC7(p),BC7(1+p)
#define BC9(p) BC8(p),BC8(1+p)
#define BC10(p) BC9(p),BC9(1+p)
#define BC11(p) BC10(p),BC10(1+ p)
#define BC12(p) BC11(p),BC11(1+ p)
#define BC13(p) BC12(p),BC12(1+ p)
#define BC14(p) BC13(p),BC13(1+ p)
#define BC15(p) BC14(p),BC14(1+ p)
#define BC16(p) BC15(p),BC15(1+ p)
#define BC17(p) BC16(p),BC16(1+ p)
#define BC18(p) BC17(p),BC17(1+ p)
#define BC19(p) BC18(p),BC18(1+ p)
#define BC20(p) BC19(p),BC19(1+ p)
unsigned char bc[] = { BC20(0) };

--
Peter

Nov 14 '05 #8
Peter Nilsson wrote:
Keith Thompson wrote:

... There is no C construct that would be expected to cause a
compiler to run out of memory (unless it's just an incredibly
huge program, ...

It doesn't have to be 'incredibly huge'. The following 21 lines
crashes my port of gcc...

#define BC1(p) p,1+p
#define BC2(p) BC1(p),BC1(1+p)
#define BC3(p) BC2(p),BC2(1+p)
#define BC4(p) BC3(p),BC3(1+p)
#define BC5(p) BC4(p),BC4(1+p)
#define BC6(p) BC5(p),BC5(1+p)
#define BC7(p) BC6(p),BC6(1+p)
#define BC8(p) BC7(p),BC7(1+p)
#define BC9(p) BC8(p),BC8(1+p)
#define BC10(p) BC9(p),BC9(1+p)
#define BC11(p) BC10(p),BC10(1+ p)
#define BC12(p) BC11(p),BC11(1+ p)
#define BC13(p) BC12(p),BC12(1+ p)
#define BC14(p) BC13(p),BC13(1+ p)
#define BC15(p) BC14(p),BC14(1+ p)
#define BC16(p) BC15(p),BC15(1+ p)
#define BC17(p) BC16(p),BC16(1+ p)
#define BC18(p) BC17(p),BC17(1+ p)
#define BC19(p) BC18(p),BC18(1+ p)
#define BC20(p) BC19(p),BC19(1+ p)
unsigned char bc[] = { BC20(0) };


"It doesn't to be incredible huge???????"

The expansion of that makes lcc-win32 use more than 1GB
RAM.

BC1 multiplies the original expression character count by two,
then it adds 3 chars.

The other expressions multiply the character count by two
and then add 5 chars!!!

Assuming the original character count is N we have
BC1 = (2*N+3) ---------->5

BC2 = 2*(2*N+3) + 5 ----->15

BC3 = 2*(2*(2*N+3) + 5 ) + 5 )-->60

etc, this grows geometrically.

Please turn on your brain before complaining...

jacob


Nov 14 '05 #9
In article <11************ *********@l41g2 000cwc.googlegr oups.com>,
Peter Nilsson <ai***@acay.com .au> wrote:
Keith Thompson wrote:

... There is no C construct that would be expected to cause a
compiler to run out of memory (unless it's just an incredibly
huge program, ...


It doesn't have to be 'incredibly huge'. The following 21 lines
crashes my port of gcc...

#define BC1(p) p,1+p
#define BC2(p) BC1(p),BC1(1+p)
#define BC3(p) BC2(p),BC2(1+p)
#define BC4(p) BC3(p),BC3(1+p)
#define BC5(p) BC4(p),BC4(1+p)
#define BC6(p) BC5(p),BC5(1+p)
#define BC7(p) BC6(p),BC6(1+p)
#define BC8(p) BC7(p),BC7(1+p)
#define BC9(p) BC8(p),BC8(1+p)
#define BC10(p) BC9(p),BC9(1+p)
#define BC11(p) BC10(p),BC10(1+ p)
#define BC12(p) BC11(p),BC11(1+ p)
#define BC13(p) BC12(p),BC12(1+ p)
#define BC14(p) BC13(p),BC13(1+ p)
#define BC15(p) BC14(p),BC14(1+ p)
#define BC16(p) BC15(p),BC15(1+ p)
#define BC17(p) BC16(p),BC16(1+ p)
#define BC18(p) BC17(p),BC17(1+ p)
#define BC19(p) BC18(p),BC18(1+ p)
#define BC20(p) BC19(p),BC19(1+ p)
unsigned char bc[] = { BC20(0) };

--
Peter


Right! That's what I was thinking of - a good example of compile-time UB.

Nov 14 '05 #10

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

Similar topics

1
6664
by: Snake Djip | last post by:
Hi, I have a problem with a home-made DLL used in an ASP environment. It is coded in VB6, apartment-threaded. The DLL returns a binary PNG stream (an image). I use it with ASP's Response.BinaryWrite to display a dynamic image on a web page. The server is Windows 2000 SP4.
0
4068
by: John Bonds | last post by:
I have designed a multi-threaded application that manipulates images (CCITT Group 4 TIFF Images). I'm getting some strange behavior and I'm wondering if anyone else is seeing the same thing. I run a batch process that reads in pages of one of these TIFF files, separates them out into different TIFF files, saves them to a file (in a new thread) and disposes properly of all the memory that was used. I run this batch process and monitor the...
3
3993
by: gambler | last post by:
let's say you have: var games = new Array(); games = new GAME(gameNum, rotNum1, rotNum2, ... ); ( so a sparsley populate array which enables me to locate a game usin the game number without having to implement a "search" function on th games array
11
5277
by: Shane Suebsahakarn | last post by:
Hi all, This might be one of those things for which there is no workaround. I'm using A2K2, and using it to perform a very large batch ouput. Both the front and back ends are MDB files, so no SQL Server involved here. Both SP3 and Jet SP8 have been updated, and the platform is running on a dual-processor 3Ghz Xeon Win2K3 Server box with 2GB RAM. The batch run outputs 6 or 7 reports to approximately 16-17,000 snapshot files None of the...
0
1577
by: SC | last post by:
I'm a newie in .net, and here is my problem. I have a windows application that pass trough a proxy to access a webservice. I use the following code to set the proxy: GlobalProxySelection.Select = new WebProxy(new Uri("http://ip:port/"),true); GlobalProxySelection.Select.Credentials = new NetworkCredential(usr, pass); Well, the problem is that i get an "The operation has timed-out" error. I try a lot of different ways to set the...
2
1914
by: WJScott69 | last post by:
C# - CSharp - WIN32 - WMI Progamming Issues with NT4 (Out of Memory) Hello, I am trying to inquire on servers ranging from Windows NT4 SP6a+ to Windows 2000-2003 I have the program working fine on all but the NT4 where I get a Out of Memory error. Please take a look at the enclosed project and let me know how I go about resolving this. I can get results from NT4 server but dont seem to be able to collect everything I need. I have even...
4
6875
by: Rachel McConnell | last post by:
Hello, I have a Java web application using Hibernate to connect to a PostgreSQL backend. I am seeing the below stack trace during processing of a set of data consisting of around 1000 objects; for a 200 object set I don't see the exception. I believe the salient point is the Out Of Memory bit - marked below by *****'s The fact that this exception occurs during a call to
4
6937
by: lawrence k | last post by:
I've a jpeg image that is 514k, which doesn't strike me as very large. Yet I'm running out of error when I try to resize it: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 12288 bytes) in /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/resizeImageToSquare.php on line 82 How can I protect against out-of-memory errors?
1
1039
by: =?Utf-8?B?QXJuZSBCZXJ1bGRzZW4=?= | last post by:
I'm relatively new to vb.net (2005) and I continually experience an out of memory exception during the development process...and this is becoming a big pain!! I have 2gigs of memory and this never happened in vb6. Is there something I can do to fix this? Thanks
0
9287
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9886
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9722
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8723
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7259
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6542
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3369
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.