Free Support Forum - aspose.com

Out of Memory issue when calucating the page count for PDF document using aspose Library

We are doing load testing in out TT enviorenment and after few hours our app server is crashing

From dump file analysis we saw lot of objects like the following on heap

552,368 (0%) [16] 1 com/aspose/pdf/engine/data/e 0xb28fc790
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3e603ff8
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3d100
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3d6d0
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3d860
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3d980
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3dc20
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3ddd0
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3e5fd4f8
552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3e5fdb68

Code snippet used

AposeLicenseLoader singletonLoader = AposeLicenseLoader.getInstance();
if(logger.isDebugEnabled())
logger.debug("License generated successfully");


com.aspose.pdf.Document pdfDoc = null;
try
{
pdfDoc = new com.aspose.pdf.Document(fileContents.getInputStream());
logger.debug("Retrieve document page count");
int pages = pdfDoc.getPages().size();
logger.debug("Document page count is : " + pages);
return pages;
} finally
{
if(pdfDoc!=null)
pdfDoc.dispose();
pdfDoc=null;

}

AposeLicenseLoader code

public class AposeLicenseLoader implements Serializable {

private static AposeLicenseLoader aposeLicenseLoader = null;

static Object locker=new Object();

private static final long serialVersionUID = 1L;

// private Constructor

private AposeLicenseLoader()

{

loadLicense();

}

public static AposeLicenseLoader getInstance()

{

if (aposeLicenseLoader == null)

{

synchronized (locker)

{

if (aposeLicenseLoader == null)

{

aposeLicenseLoader = new AposeLicenseLoader();

}

}

}

return aposeLicenseLoader;

}

/***

*

*/

private void loadLicense()

{

String fileName = "Aspose.Total.Java.lic";

String licensePath= System.getProperty(Constants.APP_CONFIG)+"/"+fileName;

License license=new License();

license.setLicense(licensePath);

}

/***

*

* @return

*/

private Object readResolve()

{

return getInstance();

}

}


This is related to Java

Hi Robert,


Thanks for contacting support.

Can you please share the source PDF files and some information regarding your working environment so that we can test the scenario at our end. We are really sorry for this inconvenience.

Hello,

We are also facing similar issue while calculating page count. We are running this code under IBM WAS server and it is not specific to one file. It is failing with all pdf files:

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Object Memory

---------------

Total memory:
3214868480 (0x00000000BF9F0000) = 3065.94mb

Total memory in use: 3201124880 (0x00000000BECD4A10) =
3052.83mb

Total memory free: 13743600
(0x0000000000D1B5F0) = 13.11mb



Heap dump file name /ecurep/pmr/8/6/86495,999,000/2013-08-21/86495.999.000.heapdump.20130821.011323.23264.0002.phd.gz_unpack/86495.999.000.heapdump.20130821.011323.23264.0002.phd

Java Version JRE 1.6.0 Linux amd64-64 build 20120919_122629
(pxa6460_26sr3ifix-20121005_02(SR3+IV27268+IV27928+IV28217+IV25699))

Number of Classes 31,669

Number of Objects 28,791,980

Number of ObjectArrays 1,878,741

Number of PrimitiveArrays 3,500,055

Total Number of Instances 34,202,445

Total Number of References 48,784,157

Number of roots 68,108

Number of types 31,162

Heap range 0x22d0000 to 0xc174db50

Java heap usage 3,197,269,112 bytes



2,092,536,600 (65%) [672,536] 81,571 array of java/lang/Object
0xb67c9f98

552,368 (0%) [16] 1 com/aspose/pdf/engine/data/e 0xb28fc790

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3e603ff8

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3d100

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3d6d0

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3d860

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3d980

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3dc20

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3de3ddd0

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3e5fd4f8

552,336 (0%) [16] 1 com/aspose/pdf/engine/data/e 0x3e5fdb68

There are 81,561 more children<!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

Hi Robert,


Thanks for sharing the details.

I have logged this problem as PDFNEWJAVA-33673 in our issue tracking system. We
will investigate this issue in details and will keep you updated on the status
of a correction.

We apologize for your inconvenience.

"I have logged this problem as PDFNEWJAVA-33673 in our issue tracking system."

Any update on this issue?

Hi Robert,


<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
color:#333333;background:white”>The development team has been busy resolving
other priority issues and I am afraid the above stated problem is not yet
resolved. Nevertheless, I have requested the development team to share any
possible ETA. As soon as I have some updates regarding its resolution, I would
be more than happy to update you with the status of correction. Please be
patient and spare us little time.<o:p></o:p>

We are sorry for this delay and inconvenience.

Can you provide status on PDFNEWJAVA-33673 ?

Do you have ETA?

Thank you.

Hi,

I am afraid the issue is not yet resolved. Please note that as a normal rule of practice, issues are resolved in first come and first serve basis; but the problems logged/reported under Enterprise or Priority support model, have high precedence in terms of resolution, as compare to issues under normal/free support model.

In case you need to have your issue prioritized, you may consider opting for Enterprise or Priority support options. Nonetheless, note that ES/PS support does not guarantee any immediate resolution of issues (because it might be dependent on other issues or feature which needs to be implemented) but under this model, the development team starts investigating the problem on high priority. For further details, please visit Support Options.

We are sorry for this delay and inconvenience.

Please advise how to escalate this issue to Enterprise support. We purchased the Enterprise license but I do not have access to the Enterprise forums.

Also keep in mind this issue was opened on 8/21/2013 so the clock should not "reset".

Thank you.

boadean:
Please advise how to escalate this issue to Enterprise support. We purchased the Enterprise license but I do not have access to the Enterprise forums.
Hi,

In order to access Enterprise Support forum, you need to log-in through the username against which you have purchased ES support. Did you purchase the ES against your current boadean username or with any other name ? Please share some details, so we may further look into this matter.

boadean:
Also keep in mind this issue was opened on 8/21/2013 so the clock should not “reset”.

Once you are logged in with ES username, you can request to raise the priority of earlier reported issue in ES forums and we will increase its priority in Issue tracking system. Nonetheless, the issue will then be investigated and resolved on high priorities. We are sorry for your inconvenience.

The issues you have found earlier (filed as PDFNEWJAVA-33673) have been fixed in Aspose.Pdf for Java 10.4.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.