473,386 Members | 1,644 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,386 software developers and data experts.

second run of my program

14
I have a very large object. When I run my program first time it runs just fine. But if I want to re-run it it fails by saying that it is out of memory. Any suggestions? Perhaps, should I call destractor (sp?) after I am done working with my object and need to run my program the second time. I am not sure how to do it. Perhaps, is there a function in python that clears all the memory? Thanks.
Dec 23 '09 #1
2 1244
bvdet
2,851 Expert Mod 2GB
It's hard to say without seeing your code. Python performs a garbage collection when an object's reference count reaches 0. An object's reference count is decreased whenever a it goes out of scope or is reassigned. It also can be decreased by the del statement. You should not have a problem like this.
Dec 26 '09 #2
Glenton
391 Expert 256MB
Yeah, I agree. Most often a little bit of care will sort out any problems. A bit more sense of the code, perhaps a minimum working example or something. Python doesn't keep track of your RAM, so if your object gets too big, then tough luck! But, as I say, with care this is almost never a problem. Eg do you need the whole lot in RAM? Anyway, it's hard to know without seeing the object in question.

Also, what operating system and how much RAM etc might be helpful, if you think this is really the issue.
Dec 27 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Jurgen Oerlemans | last post by:
I have a code where I perform several actions on files. Between these actions I want to wait for 1 second. Or 2 seconds. How can I easily do this without using a timer? Jurgen
5
by: Ben Jeurissen | last post by:
Hello, I have to deal with the following issue in C++: Two threads are started from the main thread, both capturing images from a different firewire camera. Both threads take shots of 460800...
6
by: Charlie Zender | last post by:
Hi, I have a program which takes the output filename argument from stdin. Once the program knows the output filename, it tries to open it. If the output file exists, the program asks the user to...
1
by: MKJ | last post by:
Oleg Starodumov wrote: > *You can download Debugging Tools for Windows and install them: > http://www.microsoft.com/whdc/ddk/debugging/default.mspx > > Then run the following command at the...
1
by: Michael | last post by:
Is it possible to make a 1992 flops.c program by Al Alburto which compiled in VC++ 6.0 on Windows XP work on a Pocket PC with windows mobile 2003 second edition. I haven't programmed for a long...
10
by: moti | last post by:
I need to check for the existence of a file (the filename and folder are known). The file may be created at any time, before or after the start of the file check. As I do not want to burden the...
8
by: Rick Lederman | last post by:
I am using a PrintDocument and PrintDialog to print. The first time that I print it works, but when I try to print a second time without exiting the entire program I get an...
3
by: Arun Nair | last post by:
''' Can anyone help me with this program it just takes probability of the first team and runs the program doesnt takes the probability of the second team even though specified''' from random...
3
by: Samkos | last post by:
Hi there, I am fighting with a problem I intended to believe trivial that I could not solve yet! I am trying to have a button with a variable text, that pops up another button with a...
5
by: raseelbhagat | last post by:
Hi, I am writing a simple program in which I am using scnaf() twice. The pseudo code of the program is as follows : .... printf("Enter lesson no.:"); scanf("%d",lesson); ... fp =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...

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.