帮助解密logcat输出-过多的JNI全局引用

如何解决帮助解密logcat输出-过多的JNI全局引用

|| 谁能给我任何提示,导致我的应用程序中止并提供此输出?
I/ActivityManager(   68): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=MapDroid.MapDroid/mapdroid.StudentList } from pid 223
I/ActivityManager(   68): Start proc MapDroid.MapDroid for activity MapDroid.MapDroid/mapdroid.StudentList: pid=506 uid=10036 gids={3003}
I/ActivityThread(  506): Pub MapDroid.MapDroid.__mono_init__: mono.MonoRuntimeProvider
D/dalvikvm(  506): Trying to load lib /data/data/MapDroid.MapDroid/lib/libmonodroid.so 0x40512d80
D/dalvikvm(  506): Added shared lib /data/data/MapDroid.MapDroid/lib/libmonodroid.so 0x40512d80
D/dalvikvm(  506): GC_CONCURRENT freed 1219K,57% free 2906K/6727K,external 1625K/2137K,paused 19ms+5ms
I/ActivityManager(   68): Displayed MapDroid.MapDroid/mapdroid.StudentList: +16s949ms
D/dalvikvm(  223): GC_EXPLICIT freed 41K,50% free 2940K/5767K,external 5937K/7285K,paused 88ms
D/dalvikvm(  506): GC_EXPLICIT freed 177K,56% free 2976K/6727K,external 1671K/2137K,paused 71ms
D/dalvikvm(  506): GC_FOR_MALLOC freed 2K,56% free 2974K/6727K,paused 50ms
I/dalvikvm-heap(  506): Grow heap (frag case) to 7.125MB for 22008-byte allocation
D/dalvikvm(  506): GC_FOR_MALLOC freed 0K,56% free 2995K/6791K,paused 72ms
D/dalvikvm(  506): GREF has increased to 201
D/dalvikvm(  506): GREF has increased to 301
D/dalvikvm(  506): GREF has increased to 401
D/dalvikvm(  506): GREF has increased to 501
D/dalvikvm(  506): GREF has increased to 601
D/dalvikvm(  506): GREF has increased to 701
D/dalvikvm(  506): GREF has increased to 801
D/dalvikvm(  506): GREF has increased to 901
D/dalvikvm(  506): GREF has increased to 1001
D/dalvikvm(  506): GREF has increased to 1101
D/dalvikvm(  506): GREF has increased to 1201
D/dalvikvm(  506): GREF has increased to 1301
D/dalvikvm(  506): GREF has increased to 1401
D/dalvikvm(  506): GREF has increased to 1501
D/dalvikvm(  506): GREF has increased to 1601
D/dalvikvm(  506): GREF has increased to 1701
D/dalvikvm(  506): GREF has increased to 1801
D/dalvikvm(  506): GREF has increased to 1901
D/dalvikvm(  506): GREF has increased to 2001
W/dalvikvm(  506): Last 10 entries in JNI global reference table:
W/dalvikvm(  506):  1991: 0x40567bf0 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  1992: 0x40567c00 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  1993: 0x40567b60 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  1994: 0x40567b70 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  1995: 0x40567b80 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  1996: 0x40561ab8 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  1997: 0x40561ac8 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  1998: 0x40561ad8 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  1999: 0x4055eef0 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506):  2000: 0x4055ef00 cls=Lmono/android/runtime/JavaObject; (12 bytes)
W/dalvikvm(  506): JNI global reference table summary (2001 entries):
W/dalvikvm(  506):    50 of Ljava/lang/Class; 164B (40 unique)
W/dalvikvm(  506):    47 of Ljava/lang/Class; 188B (17 unique)
W/dalvikvm(  506):     6 of Ljava/lang/Class; 212B (6 unique)
W/dalvikvm(  506):    11 of Ljava/lang/Class; 236B (6 unique)
W/dalvikvm(  506):     2 of Ljava/lang/Class; 260B (2 unique)
W/dalvikvm(  506):     5 of Ljava/lang/Class; 284B (2 unique)
W/dalvikvm(  506):     6 of Ljava/lang/Class; 308B (5 unique)
W/dalvikvm(  506):     3 of Ljava/lang/Class; 332B (2 unique)
W/dalvikvm(  506):     1 of Ljava/lang/Class; 356B
W/dalvikvm(  506):     2 of Ljava/lang/Class; 380B (1 unique)
W/dalvikvm(  506):     2 of Ljava/lang/Class; 428B (2 unique)
W/dalvikvm(  506):     1 of Ljava/lang/Class; 452B
W/dalvikvm(  506):     1 of Ljava/lang/Class; 476B
W/dalvikvm(  506):     1 of Ljava/lang/Class; 500B
W/dalvikvm(  506):     1 of Ljava/lang/Class; 548B
W/dalvikvm(  506):     1 of Ljava/lang/Class; 572B
W/dalvikvm(  506):     2 of Ljava/lang/Class; 596B (2 unique)
W/dalvikvm(  506):     1 of Ljava/lang/Class; 692B
W/dalvikvm(  506):     1 of Ljava/lang/Class; 1004B
W/dalvikvm(  506):     2 of Ljava/lang/Class; 1172B (2 unique)
W/dalvikvm(  506):     1 of Ljava/lang/Class; 1316B
W/dalvikvm(  506):     1 of Ljava/lang/Class; 3452B
W/dalvikvm(  506):     1 of Ljava/lang/String; 28B
W/dalvikvm(  506):     2 of Ldalvik/system/VMRuntime; 12B (1 unique)
W/dalvikvm(  506):     9 of Ljava/lang/ref/WeakReference; 28B (9 unique)
W/dalvikvm(  506):     1 of Ljava/lang/ref/WeakReference; 36B
W/dalvikvm(  506):     1 of Ldalvik/system/PathClassLoader; 44B
W/dalvikvm(  506):     1 of Landroid/app/ActivityThread$ApplicationThread; 28B
W/dalvikvm(  506):     1 of Landroid/content/ContentProvider$Transport; 28B
W/dalvikvm(  506):     1 of Landroid/view/inputmethod/InputMethodManager$ControlledInputConnectionWrapper; 36B
W/dalvikvm(  506):     1 of Landroid/view/ViewRoot$1; 12B
W/dalvikvm(  506):     1 of Landroid/view/ViewRoot$W; 28B
W/dalvikvm(  506):     1 of Landroid/view/inputmethod/InputMethodManager$1; 28B
W/dalvikvm(  506):     1 of Landroid/view/accessibility/AccessibilityManager$1; 28B
W/dalvikvm(  506):     2 of Lorg/apache/harmony/xnet/provider/jsse/TrustManagerImpl; 28B (1 unique)
W/dalvikvm(  506):     1 of Lmapdroid/StudentList_GetStudentsTask; 28B
W/dalvikvm(  506):  1099 of Lmono/android/runtime/JavaObject; 12B (1099 unique)
W/dalvikvm(  506):   729 of Lmono/android/runtime/JavaObject; 20B (729 unique)
W/dalvikvm(  506):     1 of Lmapdroid/StudentList; 180B
W/dalvikvm(  506): Memory held directly by tracked refs is 58440 bytes
E/dalvikvm(  506): Excessive JNI global references (2001)
E/dalvikvm(  506): VM aborting
D/Zygote  (   33): Process 506 exited cleanly (1)
I/ActivityManager(   68): Process MapDroid.MapDroid (pid 506) has died.
I/WindowManager(   68): WIN DEATH: Window{406a8598 MapDroid.MapDroid/mapdroid.StudentList paused=false}
W/InputManagerService(   68): Got RemoteException sending setActive(false) notification to pid 506 uid 10036
StudentList.cs的代码
using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using MonoMap;
using MonoMap.wsMobile;

namespace MapDroid
{
    public class StudentList : Activity
    {

        private int currentFacultyId = 93306;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //Show Loading Layout
            SetContentView(Resource.Layout.SplashLoad);

            // init AsycTask and Execute
            GetStudentsTask gstask = new GetStudentsTask(this,currentFacultyId);
            gstask.Execute();

        }

        /***
         * Callback after GetStudentsTask completes
         * 
         **/
        protected void ShowList(ArrayAdapter<Student> adapter)
        {
            SetContentView(Resource.Layout.LayoutStudentList);

            //Grab Views
            ListView lvStudent = FindViewById<ListView>(Resource.Id.studentListView);
            EditText etFilter = FindViewById<EditText>(Resource.Id.studentFilter);

            //Attach Adapter to ListView
            lvStudent.Adapter = adapter;

            //Use delegate to filter list on TextChanged
            etFilter.TextChanged += delegate(object sender,Android.Text.TextChangedEventArgs e)
            {
                adapter.Filter.InvokeFilter(e.Text.ToString());
            };

            //Use delagate to fire intent on ItemClick
            lvStudent.ItemClick += delegate(object sender,ItemEventArgs args)
            {
                Student selectedStudent = adapter.GetItem(args.Position);
                Intent intent = new Intent(this,typeof(TabbedView));
                intent.PutExtra(\"studentId\",selectedStudent.I.ToString());
                intent.PutExtra(\"studentName\",selectedStudent.F.ToString() + \" \" + selectedStudent.L.ToString());
                intent.PutExtra(\"facultyId\",currentFacultyId.ToString());
                StartActivity(intent);
            };  
        }

        /**
         * AsycTask Implementation to Get All Associated Students
         * 
         */ 
        internal class GetStudentsTask : AsyncTask
        {

            private ArrayAdapter<Student> _adapter;
            private StudentList _outer;
            private int _facId;

            public GetStudentsTask(StudentList outer,int currentFacultyId)
            {
                this._outer = outer;
                this._facId = currentFacultyId;
            }

            protected override Java.Lang.Object DoInBackground(params Java.Lang.Object[] @params)
            {
                //Setup Adapter Data Source
                Student[] students = WebService.GetStudentListbyFacultyId(_facId);
                _adapter = new ArrayAdapter<Student>(_outer,Resource.Layout.ItemStudent,students);
                return true;
            }

            protected override void OnPostExecute(Java.Lang.Object result)
            {
                _outer.ShowList(_adapter);
                base.OnPostExecute(result);
            }
        }
    }
}
另一个奇怪的问题是它可以在实际设备上正常运行,但是在尝试在仿真器上运行时,它会给我这个输出并中止... 有想法吗?     

解决方法

        仿真器上的全局引用限制为2000。如果我没记错的话,在设备上,全局引用限制为〜52000。您正在执行的操作是创建并保留过多的对象。     

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-