Big_Integer's blog

By Big_Integer, history, 5 years ago, In English

Hi I was just upsolving some problems when a weird thing caught my attention. I was trying to write an efficient code that was much lighter and less complex compared to the previous submission of a problem.

The previous submission had 15 ms and 0KB, and the newer one has 0 ms and 3600KB It took extra 3600KB that it ain't suppose to take (⊙_⊙)

Yeah, I had 50% success yet, it made me confused, " Why you eat so much memory program? ", This question was bugging me literary so I submitted a blank code.

So, you can see that this Blank code is also taking 3600KB you can also see for yourself by checking it in the custom test.

Can someone please explain, why is this weird behavior? because of the Compiler Flag or something else? I know this should not be any issue, but I just can't get over it.

Thank you.

  • Vote: I like it
  • +13
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +26 Vote: I do not like it

Generally each process is allocated some space in RAM which includes code section, data section, stack etc. The code section is non empty and some stack space is also allocated.

»
5 years ago, # |
  Vote: I like it +63 Vote: I do not like it

Your last tag is what my parents ask, most of the time :(

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How does Codeforces measure the memory usage? Is it something on the command line we can do locally (for stress testing purposes)?