Page 1 of 1

Full GC caused by BinaryPartAbstractImage#createImagePart

PostPosted: Mon May 13, 2013 3:22 am
by zams
This is just a post for the benefit to whom is experiencing the full GC issue caused by embedding images in docx.

public static BinaryPartAbstractImage createImagePart(
OpcPackage opcPackage,
Part sourcePart, byte[] bytes)
...

explicitly invokded System.gc() which caused high CPU load and performance issue. To avoid high CPU load/frequent full GC, better to use
public static BinaryPartAbstractImage createImagePart(
OpcPackage opcPackage,
Part sourcePart, File imageFile)