Results 1 to 2 of 2
  1. #1
    Daniel is offline Member
    Join Date
    Jun 2007
    Posts
    91
    Rep Power
    0

    Default Consumption of memory

    I want to measure the consumption of memory that implies certain action (upload a pdf with the library pdfbox), with the purpose of to determine in approximate form (to know if it puts all the pdf in single memory or the structure of this).
    Last edited by Daniel; 07-06-2007 at 09:09 PM.

  2. #2
    Eric is offline Senior Member
    Join Date
    Jun 2007
    Posts
    111
    Rep Power
    0

    Default

    Try something like that:
    Java Code:
    System.out.println(Runtime.getRuntime().freeMemory());     
    long memoryBefore = Runtime.getRuntime().freeMemory();
    PDDocument document = PDDocument.load("c:\\01.pdf");
    long memoryAfter = Runtime.getRuntime().freeMemory();
    System.out.println( (memoryBefore -long memoryAfter));

Similar Threads

  1. Low memory error
    By rlhs76 in forum New To Java
    Replies: 2
    Last Post: 02-08-2008, 10:25 PM
  2. Out of memory
    By mew in forum New To Java
    Replies: 1
    Last Post: 01-20-2008, 08:55 AM
  3. Memory leakage problem
    By Amali_Prem in forum New To Java
    Replies: 0
    Last Post: 01-17-2008, 10:45 AM
  4. Memory
    By mew in forum CLDC and MIDP
    Replies: 0
    Last Post: 12-28-2007, 11:02 AM
  5. How Can I get free memory ?
    By sathish_2111 in forum Networking
    Replies: 2
    Last Post: 07-19-2007, 04:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •