{"action":"created","issue":{"url":"https://api.github.com/repos/RobotiumTech/robotium/issues/328","labels_url":"https://api.github.com/repos/RobotiumTech/robotium/issues/328/labels{/name}","comments_url":"https://api.github.com/repos/RobotiumTech/robotium/issues/328/comments","events_url":"https://api.github.com/repos/RobotiumTech/robotium/issues/328/events","html_url":"https://github.com/RobotiumTech/robotium/issues/328","id":101956849,"number":328,"title":"Strange behaviours on big projects","user":{"login":"renas","id":165541,"avatar_url":"https://avatars.githubusercontent.com/u/165541?v=3","gravatar_id":"","url":"https://api.github.com/users/renas","html_url":"https://github.com/renas","followers_url":"https://api.github.com/users/renas/followers","following_url":"https://api.github.com/users/renas/following{/other_user}","gists_url":"https://api.github.com/users/renas/gists{/gist_id}","starred_url":"https://api.github.com/users/renas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renas/subscriptions","organizations_url":"https://api.github.com/users/renas/orgs","repos_url":"https://api.github.com/users/renas/repos","events_url":"https://api.github.com/users/renas/events{/privacy}","received_events_url":"https://api.github.com/users/renas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RobotiumTech/robotium/labels/bug","name":"bug","color":"FFFFFF"},{"url":"https://api.github.com/repos/RobotiumTech/robotium/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/RobotiumTech/robotium/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-08-19T17:45:17Z","updated_at":"2015-08-19T17:46:20Z","closed_at":null,"body":"_From [alex.gi...@gmail.com](https://code.google.com/u/106277910938818275510/) on April 18, 2012 03:18:02_\n\nWhat steps will reproduce the problem? 1.Create test steps with one intent flagged ACTIVITY_CLEAR_TOP or other flags that Robotium conception does not take into account.\r\n2.Call solo.finishOpenedActivities() What is the expected output? What do you see instead? My test should terminate. Instead, I can get functional exceptions, outOfMemoryExceptions due to activities that are unfrozen while they should no more exist, hanging InstrumentationTestRunner, ... What version of the product are you using? On what operating system? Will crash on any SDK and every version of robotium Please provide any additional information below. This is a conception flaw. I think the problem was raised on issue #219 , and rejected. But the problem does exist.\r\nThe whole conception of keeping a hard reference upon the \"stack\" of activities is wrong. Android activity manager is much more complex than a simple stack, and stacking activities into an inner object leaks the robotium tests, and bypasses the application expected functional workflow. When a hard reference is kept upon an activity, you prevent Android from managing activities and garbage collecting objects the way it wants to, then the tested application behaves strangely : OutOfMemory (because you keep reference upon an activity that has reference upon bitmaps that can not be garbagecollected), functional exceptions because finishOpenedActivities() calls finish() on activities that should no more exist (for example when an intent is started with flag ACTIVITY_CLEAR_TOP, or NO_HISTORY), hence implemented activity does not handle this unnatural behaviour.\r\nA temporary patch should be to keep a stack of WeakReference<Activity> within the activity stack, to prevent robotium from leaking the whole application then randomly crashing the instrumentationtestrunner. But I don't get the point of keeping the stack at all... Why should this be necessary in a blackbox test ? \r\n\r\nRobotium is a great framework, but this point of conception really is painful. This problem keeps crashing our Jenkins continuous integration, holding all executors whenever it happens, and forcing us to allocate 256Mo heaps emulators to prevent OutOfMemory ! \r\nIf I can help in any way, please let me know.\n\n_Original issue: http://code.google.com/p/robotium/issues/detail?id=249_"},"comment":{"url":"https://api.github.com/repos/RobotiumTech/robotium/issues/comments/132716898","html_url":"https://github.com/RobotiumTech/robotium/issues/328#issuecomment-132716898","issue_url":"https://api.github.com/repos/RobotiumTech/robotium/issues/328","id":132716898,"user":{"login":"renas","id":165541,"avatar_url":"https://avatars.githubusercontent.com/u/165541?v=3","gravatar_id":"","url":"https://api.github.com/users/renas","html_url":"https://github.com/renas","followers_url":"https://api.github.com/users/renas/followers","following_url":"https://api.github.com/users/renas/following{/other_user}","gists_url":"https://api.github.com/users/renas/gists{/gist_id}","starred_url":"https://api.github.com/users/renas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renas/subscriptions","organizations_url":"https://api.github.com/users/renas/orgs","repos_url":"https://api.github.com/users/renas/repos","events_url":"https://api.github.com/users/renas/events{/privacy}","received_events_url":"https://api.github.com/users/renas/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T17:46:20Z","updated_at":"2015-08-19T17:46:20Z","body":"_From [markper...@gmail.com](https://code.google.com/u/100945538260448177391/) on June 08, 2012 08:10:05_\n\nHi Renas,\r\n\r\nCould you please send me the jar file as well?  Like others I was wondering when you would be releasing this version.\r\n\r\nThanks,\r\nMark"}}