New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
64 bit python memory leak usage #46904
Comments
For the code below.. memory usage keeps increasing continuously.. This linux kernel version (both on 32-bit and 64 bit machine) now = datetime.datetime.now()
oneday = datetime.timedelta(days=1)
def birthdaycompare(a, b):
if a is None and b:
return 1
if a and b is None:
return -1
if a is None and b is None:
return 0
if a<b:
return -1
elif a==b:
return 0
else:
return 1
def compare_by(fieldname):
def comparedict(a,b):
return birthdaycompare(a[fieldname], b[fieldname])
return comparedict
def getbirthdays(friend_details):
new_f = []
birthday = None
birthday_dt = None
for f in friend_details:
if f.has_key('birthday'):
birthday = f['birthday']
if birthday and birthday !='':
birthday_split = birthday.split(',')[0]
if birthday_split == 'February 29':
birthday = 'February 28'
try:
birthday_dt =
datetime.datetime.strptime(birthday_split + ', ' + str(now.year) , '%B
%d, %Y')
if birthday_dt < (now - oneday):
birthday_dt =
datetime.datetime.strptime(birthday_split + ', ' + str(now.year+1) ,
'%B %d, %Y')
except:
birthday=None
birthday_dt=None
new_f.sort(compare_by('birthday_dt')) |
Please provide a "main" function to test with. |
Closing since no further information was given about the workload. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: