Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
negative memory usage
#2
(Apr-27-2024, 07:41 AM)akbarza Wrote: the usage of memory is shown as a negative number! why?
I think it is negative because the code deletes the previously calculated list cubes. You could correct this by running
del cubes
m3 = ...
Another major problem with your code is that the call to check_even_gene() creates a generator but it does not actually calculate the data num * num, so it basically does nothing.

Also note that num * num is not the cube of the number num.
« We can solve any problem by introducing an extra level of indirection »
Reply


Messages In This Thread
negative memory usage - by akbarza - Apr-27-2024, 07:41 AM
RE: negative memory usage - by Gribouillis - Apr-27-2024, 08:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  is there any tool to convert negative base to int? Skaperen 7 2,479 May-27-2022, 07:30 AM
Last Post: Gribouillis
  Reducing runtime memory usage in Cpython interpreter david_the_graower 2 2,285 Oct-18-2021, 09:56 PM
Last Post: david_the_graower
  Def code does not work for negative integers. doug2019 1 1,978 Oct-31-2019, 11:00 PM
Last Post: ichabod801
  offset can not be negative in File.seek()? jollydragon 6 7,103 Sep-28-2019, 03:08 AM
Last Post: jollydragon
  Positive to negative bernardoB 6 4,480 Mar-13-2019, 07:39 PM
Last Post: bernardoB
  How to get memory usage and execution time of each line in python SriRajesh 2 3,207 Mar-07-2019, 12:59 PM
Last Post: SriRajesh
  negative to positive slices Skaperen 3 3,695 Jan-29-2018, 05:47 AM
Last Post: Skaperen
  Pyglet Media: unjustifiable memory usage hbknjr 4 4,679 Aug-20-2017, 02:08 AM
Last Post: hbknjr
  Negative lookahead not working, help please MitchBuchanon 8 6,080 Mar-01-2017, 02:41 PM
Last Post: Ofnuts
  Negative numbers and fractional powers Flexico 1 4,938 Dec-08-2016, 04:12 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020