{"action":"created","issue":{"url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2461","repository_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner","labels_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2461/labels{/name}","comments_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2461/comments","events_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2461/events","html_url":"https://github.com/opentripplanner/OpenTripPlanner/issues/2461","id":237893795,"node_id":"MDU6SXNzdWUyMzc4OTM3OTU=","number":2461,"title":"TemporaryPartialStreetEdge is not cleaned up from graph after a plan call","user":{"login":"sdjacobs","id":5751667,"node_id":"MDQ6VXNlcjU3NTE2Njc=","avatar_url":"https://avatars2.githubusercontent.com/u/5751667?v=4","gravatar_id":"","url":"https://api.github.com/users/sdjacobs","html_url":"https://github.com/sdjacobs","followers_url":"https://api.github.com/users/sdjacobs/followers","following_url":"https://api.github.com/users/sdjacobs/following{/other_user}","gists_url":"https://api.github.com/users/sdjacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/sdjacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdjacobs/subscriptions","organizations_url":"https://api.github.com/users/sdjacobs/orgs","repos_url":"https://api.github.com/users/sdjacobs/repos","events_url":"https://api.github.com/users/sdjacobs/events{/privacy}","received_events_url":"https://api.github.com/users/sdjacobs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-22T15:57:42Z","updated_at":"2018-11-23T10:18:45Z","closed_at":null,"author_association":"COLLABORATOR","body":"## Expected behavior\r\nOTP should remove all temporary objects that are created during a plan call. Otherwise, OTP could potentially run out of memory eventually.\r\n\r\n## Observed behavior\r\nIt appears that TemporaryPartialStreetEdge objects are not removed from the graph. I added some logging to show this (see https://github.com/camsys/OpenTripPlanner/tree/add-temporary-edge-logging). My logging shows the following output (each line is *after* a plan call):\r\n\r\n    11:25:57.525 INFO (PlannerResource.java:111) Graph has 139443 vertices and 321002 edges, last edge type=org.opentripplanner.routing.edgetype.TemporaryPartialStreetEdge\r\n    11:25:59.258 INFO (PlannerResource.java:111) Graph has 139443 vertices and 321004 edges, last edge type=org.opentripplanner.routing.edgetype.TemporaryPartialStreetEdge\r\n    11:26:16.956 INFO (PlannerResource.java:111) Graph has 139443 vertices and 321006 edges, last edge type=org.opentripplanner.routing.edgetype.TemporaryPartialStreetEdge\r\n\r\n## Version of OTP used (exact commit hash or JAR name)\r\nThe current head commit (2afdbec0caa18eb34b277d795a0077058344210a) plus some logging from the branch linked above (see [commit](https://github.com/camsys/OpenTripPlanner/commit/b1fd5611d171c16b5d79d14394f44eb8833dc68e), does not change any behavior.) I also tested with versions 1.0.0 and 1.1.0 and observed the same behavior.\r\n\r\n## Data sets in use (links to GTFS and OSM PBF files)\r\nI do not think this issue is data-related, but I am using:\r\n- Vermont [OSM](http://download.geofabrik.de/north-america/us/vermont-latest.osm.pbf)\r\n- Green Mountain Transit [GTFS](https://transitfeeds.com/p/green-mountain-transit-agency/561/latest/download)\r\n\r\n\r\n## Command line used to start OTP\r\n`--build /var/otp/graphs/vermont --preFlight --server`\r\n\r\n## Router config and graph build config JSON\r\nNone\r\n\r\n## Steps to reproduce the problem\r\nAdd logging to see number of edges in the graph after a plan call, run a few trip plan requests. \r\n"},"comment":{"url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/comments/441202340","html_url":"https://github.com/opentripplanner/OpenTripPlanner/issues/2461#issuecomment-441202340","issue_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2461","id":441202340,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTIwMjM0MA==","user":{"login":"t2gran","id":5525340,"node_id":"MDQ6VXNlcjU1MjUzNDA=","avatar_url":"https://avatars0.githubusercontent.com/u/5525340?v=4","gravatar_id":"","url":"https://api.github.com/users/t2gran","html_url":"https://github.com/t2gran","followers_url":"https://api.github.com/users/t2gran/followers","following_url":"https://api.github.com/users/t2gran/following{/other_user}","gists_url":"https://api.github.com/users/t2gran/gists{/gist_id}","starred_url":"https://api.github.com/users/t2gran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t2gran/subscriptions","organizations_url":"https://api.github.com/users/t2gran/orgs","repos_url":"https://api.github.com/users/t2gran/repos","events_url":"https://api.github.com/users/t2gran/events{/privacy}","received_events_url":"https://api.github.com/users/t2gran/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T10:18:45Z","updated_at":"2018-11-23T10:18:45Z","author_association":"MEMBER","body":"The implemented fix is slightly different from the purposed solution.\r\n\r\nTemporary objects are only added at the beginning and end. The `RoutingContext` holds a reference to the `origin` and `target`. To disconnect the temporary objects from the grap we need to find all _permanent_ objects and delete references to the request context temporary inserted elements. By recursion we can find all such places where the temporary objects are connected to an _permanent_ `Vertex`.\r\n\r\nThe responsibility to clean up is moved from the temporary objects themself to the `RoutingContext` - since there is many temporary classes and they should not know to much about their context, this both simplify the implementation and places the responsibility were is should be. "}}
{"actor":{"display_login":"t2gran"}}