title: Memory Allocation Eclipse NDK Netbeans ImageProcessing
body: <p><a href="http://i.stack.imgur.com/YKkTc.png" rel="nofollow">My problem picturized.</a></p>
  
  <p>Hi all. I'm fairly new to StackOverflow. I want to ask you guys something about my intern project. </p>
  
  <p>I coded my functions in C++, and I want to design a GUI with Java in NetBeans. They will communicate with each other via NDK.</p>
  
  <p>It's an ImageViewer, and I'm able to Crop, Rotate, Paint, Resize in my C++ code. They're real-time operations, so the Image is done at C++ then transferred to Java platform. But when the Gui is up and running, I have a memory allocation problem. Since both C++ and Java libraries will hold a copy of the Image in their memory. </p>
  
  <p>Is there some kind of way to eliminate this problem? I thought about Saving/Reloading/Flushing each time, but when the file size is too large, this means long wait times in between operations.</p>
  
  <p>I might not be really spesific, you can always ask me the parts that I couldnt explain really well. I'm looking forward to getting any help I can.</p>
  
  <p>Edit: I have google "Heap Size" and found out that it helps increasing the memory allocated for my Java application. But my real concern is creating the same image in both language memories. </p>
  
  <p>Can it be a way that one stores the Image itself, and the other just the pointer? I know Java language can't get that deep till Ram allocation, what do I need to do?</p>
  
  <p>Thank you! BS</p>