0

I'm new to this form,

I was getting an OutOfMemoryError while trying to upload a large file to dropbox via java dropbox sdk.

Here is my scenario :

Server A contains a file (>1GB) --> Server B opens a stream and passes that stream to dropbox api in java

Here is my code :

DbxRequestConfig config = new DbxRequestConfig("dropbox/java-tutorial","en_US");
    DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);
    try {
        URL url = new URL(url_d);           
        // Upload Files to Dropbox
        String fileName = url_d.substring( url_d.lastIndexOf('/')+1, url_d.length() );
        DbxFiles.FileMetadata metadata = client.files.uploadBuilder("/"+fileName).run(url.openStream());

    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (UploadException e) {
        e.printStackTrace();
    } catch (DbxException e) {
        e.printStackTrace();
    }

Can anyone give me a solution. Thank you.

Zia
  • 1,001
  • 1
  • 13
  • 25
  • Increse JVM max mem size and try again. – Antoniossss Jan 20 '16 at 12:20
  • I do not have the access to change the mem size,because i had deployed it on Openshift free tire which gives ~256mb ram. – Feeling Lazy Jan 20 '16 at 13:22
  • You better paster complete stacktrace. And more over where are references to that A file in your code, only some upload builder (but you want to DL it? or transfer it between servers?). Probably related, not seeing it whatsoever. – Antoniossss Jan 20 '16 at 13:54

0 Answers0