Opened 14 years ago

Closed 10 years ago

#57 closed enhancement (duplicate)

Excessive memory allocation

Reported by: fbossen Owned by:
Priority: minor Milestone:
Component: HM Version:
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…

Description (last modified by fbossen)

Memory allocation is excessive, possibly leading to crashes.

Memory usage has been analyzed for the following case:
class B encoding with max CU=32x32, memory snapshot during encoding of 2nd frame

  • Transform coefficients:

9 TComList objects
2040 CUs per frame
3 32x32 integer arrays per CU (luma+2*chroma), each array is 4KB
9 * 2040 * 3 * 32 * 32 * 4 = 215MB

  • Luma frame buffers: 40 * 4.48MB = 179MB
  • Chroma frame buffers: 79 * 1.12MB = 89MB
  • Bitstream buffers (TComBitStream objects): 8 * 11.87MB = 95MB

Also see attached jpeg file

Attachments (2)

Memory.jpg (97.6 KB) - added by fbossen 14 years ago. (59.2 KB) - added by ichong 14 years ago.
Qualcomm's patch for more efficient memory usage

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 years ago by fbossen

  • Description modified (diff)

Changed 14 years ago by fbossen

Changed 14 years ago by ichong

Qualcomm's patch for more efficient memory usage

comment:2 Changed 14 years ago by jzan@…

Dear Frank,

I found the same issue a couple of weeks ago, while working on some of our own ideas.

What I would suggest is that:
1) Only allocating memory when it is necessary, with the right amount, and using the type with the minimal size;
2) Once the allocated memory is not needed any more, releases it as soon as possible;
3) For those objects requiring a lot of memory, such as a frame, differentiate the memory (including meta data memory) into two groups: those needed after encoding (for future reference) and those not needed after encoding; allocate both types just before the frame is encoded, and release the second group right after the frame is encoded.

What do you think?

Best regards,

comment:3 Changed 12 years ago by davidf

  • Component set to HM

Updating component after adding WD (Text) tickets

comment:4 Changed 12 years ago by davidf

  • Cc fbossen ksuehring davidf added

comment:5 Changed 12 years ago by davidf

  • Cc jct-vc@… added

comment:6 Changed 10 years ago by fbossen

  • Type changed from defect to enhancement

comment:7 Changed 10 years ago by ksuehring

  • Resolution set to duplicate
  • Status changed from new to closed

Closed as duplicate of #59.
I'm also closing this generic memory allocation issue.

Please create new reports with suggestions where memory allocations can be optimized.

Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • David Flynn(Subscriber, Participant)
  • Frank Bossen(Reporter, Subscriber, Participant)
  • jct-vc@…(Subscriber)
  • jzan@…(Participant)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Participant, Always)