我正在尝试用2047 mb ram创建一个模拟器.当我运行它时,我收到此错误:
[2011-02-22 14:24:14 - Emulator]
[2011-02-22 14:24:14 - Emulator] This application has requested the Runtime to terminate it in an unusual way.
[2011-02-22 14:24:14 - Emulator] Please contact the application's support team for more information.
[2011-02-22 14:24:26 - Emulator] Failed to allocate memory: 8
Run Code Online (Sandbox Code Playgroud)
我知道降低数量会使它发挥作用.但是我宁愿拥有更多的ram,所以我可以测试我正在开发的游戏.我假设有更多的公羊,它会跑得更快......
有没有人在模拟器上获得2047 mb的ram?如果是这样,怎么样?你用了什么设置?你在电脑上有什么特别的改变吗?
使用Windows 7 64位,更新到最新的android sdk.我也有超过8GB的ram.我确实有一个设备(摩托罗拉里程碑)进行测试,但由于它是一个基于网络的游戏,我需要至少一个其他客户端(希望使用模拟器)除了我的手机运行.
在Java中单独的类之间共享数据的最佳方法是什么?我有一堆变量,不同的类以不同的方式在不同的文件中使用.让我试着说明我的问题的简化版本:
这是我之前的代码:
public class Top_Level_Class(){
int x, y;
// gets user input which changes x, y;
public void main(){
int p, q, r, s;
// compute p, q, r, s
doA(p,q,r);
doB(q,r,s);
}
public void doA(int p, int q, int r){
// do something that requires x,y and p, q, r
}
public void doB(int q, int r, int s){
// does something else that requires x, y and q, r, s
}
}
Run Code Online (Sandbox Code Playgroud)
现在它看起来像这样:
public class Top_Level_Class(){
int x, …Run Code Online (Sandbox Code Playgroud) 这一定非常愚蠢,但我想尝试以下方法:
long mult = 2147483647 + 2147483647 + 2;
System.out.println(mult); // result = 0
Run Code Online (Sandbox Code Playgroud)
现在,我的变速器mult将是一个10位数字,在很长的范围内.所以我不明白为什么它会因此打印出0.有谁能解释为什么?