How to deal with memory in java?

So , I decided poigratsya with neural networks, for this I chose the FANN library , made a small network , trained like all the rules , well , I decided, th little things will make from the network that would learn Linux Torvald))(the pictures 240X320) Made all and came to create the most of the network and its learning create:
layerList.add(Layer.create(76800, ActivationFunction.FANN_SIGMOID_SYMMETRIC, 0.01 f));
 layerList.add(Layer.create(153600, ActivationFunction.FANN_SIGMOID_SYMMETRIC, 0.01 f));
 layerList.add(Layer.create(153600, ActivationFunction.FANN_SIGMOID_SYMMETRIC, 0.01 f));
 layerList.add(Layer.create(153600, ActivationFunction.FANN_SIGMOID_SYMMETRIC, 0.01 f));
 layerList.add(Layer.create(1, ActivationFunction.FANN_SIGMOID_SYMMETRIC, 0.01 f));
And guess what happened ? Right ! the jvm ran out of memory.
so I have two questions :
1.How to select the jvm more RAM (I have 16gb on the computer)
2.Is there a way more economical with memory to work?
July 9th 19 at 12:56
2 answers
July 9th 19 at 12:58
Solution
1.How to select the jvm more RAM (I have 16gb on the computer)

Using the command-line options xms and xmx, when you call java.exe.

Is there a way more economical with memory to work?

Radical: give up the Java, I'm not an expert on data analysis, but I have the man who does, and it does not use Java, and I don't see it as a special advantage for neural networks.
: For Java every application takes up more RAM than it should, ideally, the JVM itself is also "ignorantly composed". - mazie.Towne commented on July 9th 19 at 13:04
What is Java? There in the NA defined inputs "fuck you", and even several layers. Just NS drawn up by illiterate and not fulfill its task. - alfonso56 commented on July 9th 19 at 13:01
: laugh about the "ignorantly composed". - Deontae.Ortiz commented on July 9th 19 at 13:07
: you answered that for me your answer was similar to the situation when you ride two people on the bus look out the window and there goes the Mercedes and they are not having this machine begin to Express the type of bad that the Mercedes and Audi much better! - Deontae.Ortiz commented on July 9th 19 at 13:10
: Don't tell me about "not having this machine", I use Java to bytecode level, or slightly above (smali), and to compare I have something, all General-purpose languages ever seen, and occasionally use many of them, and if you have a broad Outlook? - mazie.Towne commented on July 9th 19 at 13:13
: describe a small example of this "I am using Java to bytecode level" =) - Deontae.Ortiz commented on July 9th 19 at 13:16
: Reverse engineering, not going to prove anything, if you need to, you prove with your hand, write some application in Java, similar to any other language, and the Java version took more RAM. - mazie.Towne commented on July 9th 19 at 13:19
: um... why would I do that?
out I better write a server application is the same as on the other I languages and deploy it on any system without any problems and crutches - Deontae.Ortiz commented on July 9th 19 at 13:22
: It does not matter to me why you need to argue with me if you are happy in Java, work with her on health, in fact, server-side Java is too "heavy", but it can be arranged, if the server has lots of RAM and a processor with a high clock frequency, that is to say, "with reserve". - mazie.Towne commented on July 9th 19 at 13:25
July 9th 19 at 13:00
2.Is there a way more economical with memory to work?

- As advised to abandon Java.
Is to throw more RAM
- Optimize code(to not genocidal)
- Clusters?
- To take out some of the logic in native
- To make the data in the database?
- Rewrite more optimized used Libu?

Find more questions by tags Fast Artificial Neural NetworkJavaNeural networks